Changeset 2116 for box/trunk/lib/common/Configuration.h
- Timestamp:
- 28/03/2008 22:59:28 (4 years ago)
- Location:
- box/trunk
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
lib/common (modified) (1 prop)
-
lib/common/Configuration.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk
- Property svn:ignore
-
old new 11 11 release 12 12 runtest.pl 13 .hg
-
- Property svn:ignore
-
box/trunk/lib/common
- Property svn:ignore
-
old new 1 autogen_CommonException.cpp 2 autogen_CommonException.h 3 autogen_ConversionException.cpp 4 autogen_ConversionException.h 1 autogen_* 5 2 BoxConfig.h 6 3 BoxConfig.h.in 7 4 Makefile 8 5 makeexception.pl 6 BoxPortsAndFiles.h
-
- Property svn:ignore
-
box/trunk/lib/common/Configuration.h
r1776 r2116 30 30 { 31 31 public: 32 const char *mpName; // "*" for all other keys (not implemented yet) 33 const char *mpDefaultValue; // default for when it's not present 34 int Tests; 35 void *TestFunction; // set to zero for now, will implement later 32 typedef enum 33 { 34 NoDefaultValue = 1 35 } NoDefaultValue_t; 36 37 ConfigurationVerifyKey(std::string name, int flags, 38 void *testFunction = NULL); 39 // to allow passing ConfigurationVerifyKey::NoDefaultValue 40 // for default ListenAddresses 41 ConfigurationVerifyKey(std::string name, int flags, 42 NoDefaultValue_t t, void *testFunction = NULL); 43 ConfigurationVerifyKey(std::string name, int flags, 44 std::string defaultValue, void *testFunction = NULL); 45 ConfigurationVerifyKey(std::string name, int flags, 46 const char* defaultValue, void *testFunction = NULL); 47 ConfigurationVerifyKey(std::string name, int flags, 48 int defaultValue, void *testFunction = NULL); 49 ConfigurationVerifyKey(std::string name, int flags, 50 bool defaultValue, void *testFunction = NULL); 51 const std::string& Name() const { return mName; } 52 const std::string& DefaultValue() const { return mDefaultValue; } 53 const bool HasDefaultValue() const { return mHasDefaultValue; } 54 const int Flags() const { return mFlags; } 55 const void* TestFunction() const { return mTestFunction; } 56 ConfigurationVerifyKey(const ConfigurationVerifyKey& rToCopy); 57 58 private: 59 ConfigurationVerifyKey& operator=(const ConfigurationVerifyKey& 60 noAssign); 61 62 std::string mName; // "*" for all other keys (not implemented yet) 63 std::string mDefaultValue; // default for when it's not present 64 bool mHasDefaultValue; 65 int mFlags; 66 void *mTestFunction; // set to zero for now, will implement later 36 67 }; 37 68 … … 39 70 { 40 71 public: 41 const char *mpName;// "*" for all other sub config names72 std::string mName; // "*" for all other sub config names 42 73 const ConfigurationVerify *mpSubConfigurations; 43 74 const ConfigurationVerifyKey *mpKeys; 44 75 int Tests; 45 void *TestFunction; // set to zero for now, will implement later76 void *TestFunction; // set to zero for now, will implement later 46 77 }; 47 78 … … 80 111 { return LoadAndVerify(rFilename, 0, rErrorMsg); } 81 112 82 bool KeyExists(const char *pKeyName) const;83 const std::string &GetKeyValue(const char *pKeyName) const;84 int GetKeyValueInt(const char *pKeyName) const;85 bool GetKeyValueBool(const char *pKeyName) const;113 bool KeyExists(const std::string& rKeyName) const; 114 const std::string &GetKeyValue(const std::string& rKeyName) const; 115 int GetKeyValueInt(const std::string& rKeyName) const; 116 bool GetKeyValueBool(const std::string& rKeyName) const; 86 117 std::vector<std::string> GetKeyNames() const; 87 118 88 bool SubConfigurationExists(const char *pSubName) const;89 const Configuration &GetSubConfiguration(const char *pSubName) const;119 bool SubConfigurationExists(const std::string& rSubName) const; 120 const Configuration &GetSubConfiguration(const std::string& rSubName) const; 90 121 std::vector<std::string> GetSubConfigurationNames() const; 91 122
Note: See TracChangeset
for help on using the changeset viewer.
