Ignore:
Timestamp:
28/03/2008 22:59:28 (4 years ago)
Author:
chris
Message:

Allow configuration of the server port that the client will connect to
(bbackupd and bbackupquery).

Redesign ConfigurationVerify? to use classes instead of structs.

Use port 22011 instead of 2201 during tests, to reduce the chances of
conflicting with a running bbstored or other process.

Ignore autogen_* in svn:ignore everywhere instead of individual per-file
ignores.

Location:
box/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • box/trunk

    • Property svn:ignore
      •  

        old new  
        1111release 
        1212runtest.pl 
         13.hg 
  • 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 
         1autogen_* 
        52BoxConfig.h 
        63BoxConfig.h.in 
        74Makefile 
        85makeexception.pl 
         6BoxPortsAndFiles.h 
  • box/trunk/lib/common/Configuration.h

    r1776 r2116  
    3030{ 
    3131public: 
    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 
     58private: 
     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 
    3667}; 
    3768 
     
    3970{ 
    4071public: 
    41         const char *mpName;                     // "*" for all other sub config names 
     72        std::string mName; // "*" for all other sub config names 
    4273        const ConfigurationVerify *mpSubConfigurations; 
    4374        const ConfigurationVerifyKey *mpKeys; 
    4475        int Tests;       
    45         void *TestFunction;                     // set to zero for now, will implement later 
     76        void *TestFunction; // set to zero for now, will implement later 
    4677}; 
    4778 
     
    80111        { return LoadAndVerify(rFilename, 0, rErrorMsg); } 
    81112         
    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; 
    86117        std::vector<std::string> GetKeyNames() const; 
    87118         
    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; 
    90121        std::vector<std::string> GetSubConfigurationNames() const; 
    91122         
Note: See TracChangeset for help on using the changeset viewer.