SvnCpp
property.hpp
Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  * Copyright (c) 2002-2009 The RapidSvn Group.  All rights reserved.
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program (in the file GPL.txt.  
00017  * If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * This software consists of voluntary contributions made by many
00020  * individuals.  For exact contribution history, see the revision
00021  * history and logs, available at http://rapidsvn.tigris.org/.
00022  * ====================================================================
00023  */
00024 
00025 #ifndef _SVNCPP_PROPERTY_H_
00026 #define _SVNCPP_PROPERTY_H_
00027 
00028 
00029 // Ignore MSVC 6 compiler warning: debug symbol truncated
00030 #if defined (_MSC_VER) && _MSC_VER <= 1200
00031 #pragma warning (disable: 4786)
00032 #endif
00033 
00034 // Ignore MSVC 7 compiler warning: C++ exception specification
00035 #if defined (_MSC_VER) && _MSCVER > 1200 && _MSCVER <= 1310
00036 #pragma warning (disable: 4290)
00037 #endif
00038 
00039 
00040 // stl
00041 #include "svncpp/vector_wrapper.hpp"
00042 #include "svncpp/string_wrapper.hpp"
00043 
00044 // svncpp
00045 #include "svncpp/context.hpp"
00046 #include "svncpp/path.hpp"
00047 
00048 namespace svn
00049 {
00050   struct PropertyEntry
00051   {
00052     std::string name;
00053     std::string value;
00054 
00055     PropertyEntry(const char * name, const char * value);
00056   };
00057 
00058   // forward declarations
00059   class Path;
00060 
00064   class Property
00065   {
00066   public:
00067     Property(Context * context = 0,
00068              const Path & path = "");
00069 
00070     virtual ~Property();
00071 
00076     const std::vector<PropertyEntry> &
00077     entries() const
00078     {
00079       return m_entries;
00080     }
00081 
00088     void set(const char * name, const char * value);
00089 
00094     void remove(const char * name);
00095 
00096   private:
00097     Context * m_context;
00098     Path m_path;
00099     std::vector<PropertyEntry> m_entries;
00100 
00101     std::string getValue(const char * name);
00102     void list();
00103   };
00104 }
00105 
00106 #endif
00107 /* -----------------------------------------------------------------
00108  * local variables:
00109  * eval: (load-file "../../rapidsvn-dev.el")
00110  * end:
00111  */