gDcsConfig
class DcsConfig
#ifndef __Include_DcsConfig_h__
#define __Include_DcsConfig_h__
#include "XosConfig.h"
#include <string>
class DcsConfig
{
public:
DcsConfig();
DcsConfig(const std::string& dcs_dir, const std::string& config_root);
virtual ~DcsConfig();
void setConfigDir(const std::string& dir);
void setConfigRootName(const std::string& n);
std::string getConfigRootName( ) const { return name; }
void setConfigFile(const std::string& f);
void setDefaultConfigFile(const std::string& f);
std::string getConfigFile() const
{
return config.getConfigFile();
}
std::string getDefaultConfigFile() const
{
return defConfig.getConfigFile();
}
void setUseDefaultConfig(bool b)
{
useDefault = b;
}
bool isUseDefault() const
{
return useDefault;
}
virtual bool load();
std::string getDcsRootDir() const;
std::string getUserLogDir() const;
std::string getDcssHost() const;
int getDcssGuiPort() const;
int getDcssScriptPort() const;
int getDcssHardwarePort() const;
int getDcssUseSSL() const;
std::string getDcssForcedDoor() const;
StrList getDcssDisplays() const;
std::string getAuthHost() const;
int getAuthPort() const;
std::string getAuthSecureHost() const;
int getAuthSecurePort() const;
std::string getAuthMethod() const;
std::string getAuthAppName() const;
std::string getAuthTrustedCaFile() const;
std::string getAuthTrustedCaDir() const;
std::string getDcssCertificate() const;
std::string getImpersonHost() const;
int getImpersonPort() const;
std::string getImpersonReadonlyHost() const;
int getImpersonReadonlyPort() const;
std::string getImgsrvHost() const;
int getImgsrvWebPort() const;
int getImgsrvGuiPort() const;
int getImgsrvHttpPort() const;
std::string getImgsrvTmpDir() const;
int getImgsrvMaxIdleTime() const;
bool get(const std::string& key, std::string& value) const;
bool getRange(const std::string& key, StrList& ret) const;
bool set(const std::string& key, const std::string& value);
std::string getStr(const std::string& key) const;
int getInt(const std::string& key, int def) const;
std::string resolveDir(const std::string& dir) const;
protected:
XosConfig config;
XosConfig defConfig;
bool useDefault;
std::string configDir;
std::string name;
static const std::string dcs;
static const std::string dcss;
static const std::string imgsrv;
static const std::string auth;
static const std::string imperson;
void updateConfigFiles();
};
class DcsConfigSingleton {
public:
static DcsConfig& GetDcsConfig( ) {
return c_dcsConfig;
}
private:
DcsConfigSingleton( ) {
}
~DcsConfigSingleton( ) {
}
static DcsConfig c_dcsConfig;
}
// Global config
DcsConfig gDcssConfig