3 #ifndef __ARC_CONFIG_H__ 4 #define __ARC_CONFIG_H__ 8 #include <arc/XMLNode.h> 9 #include <arc/StringConv.h> 29 std::string file_name_;
37 Config(
const char *filename);
51 file_name_ = filename;
62 bool parse(
const char *filename);
69 file_name_ = filename;
72 void save(
const char *filename);
91 std::string v = ename?pnode[ename]:pnode;
92 if(v.empty())
return true;
143 void AddProxy(
const std::string& path);
147 void AddCADir(
const std::string& path);
149 void AddOToken(
const std::string& token);
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
const std::string & getFileName(void) const
Returns file name of config file or empty string if it was generated from the XMLNode subtree...
Definition: ArcConfig.h:64
Config()
Creates empty XML tree.
Definition: ArcConfig.h:32
std::string cafile
Path to CA certificate.
Definition: ArcConfig.h:121
static bool elementtobool(Arc::XMLNode pnode, const char *ename, bool &val)
Helper method for processing element value.
void GetOverlay(std::string fname)
Read overlay from file.
Config(XMLNode xml)
Acquire existing XML (sub)tree.
Definition: ArcConfig.h:44
Config(const std::string &xml_str)
Parse configuration document from string.
Definition: ArcConfig.h:39
void print(void)
Print structure of document for debugging purposes.
std::list< std::string > plugin_paths
List of file system paths to ARC plugin files.
Definition: ArcConfig.h:107
void AddOverlay(XMLNode cfg)
Add configuration overlay.
Wrapper for LibXML library Tree interface.
Definition: XMLNode.h:61
std::string cadir
Path to directory of CA certificates.
Definition: ArcConfig.h:123
Class to represent an XML namespace.
Definition: XMLNode.h:28
Configuration for client interface.
Definition: ArcConfig.h:104
Config(XMLNode xml, const std::string &filename)
Acquire existing XML (sub)tree and set config file.
Definition: ArcConfig.h:49
std::string key
Path to private key.
Definition: ArcConfig.h:115
void save(const char *filename)
Save config to file.
bool parse(const char *filename)
Parse configuration document from file at filename.
static bool elementtoenum(Arc::XMLNode pnode, const char *ename, int &val, const char *const opts[])
Helper method for processing element value.
std::string proxy
Path to proxy certificate.
Definition: ArcConfig.h:119
std::string credential
Credential stored as string.
Definition: ArcConfig.h:113
std::string otoken
Authentication token.
Definition: ArcConfig.h:125
void AddCertificate(const std::string &path)
Add certificate.
void AddCredential(const std::string &cred)
Add credential string.
void AddPluginsPath(const std::string &path)
Adds non-standard location of plugins.
void setFileName(const std::string &filename)
Set the file name of config file.
Definition: ArcConfig.h:68
Config(const NS &ns)
Creates an empty configuration object with the given namespace.
Definition: ArcConfig.h:34
void AddCADir(const std::string &path)
Add CA directory.
static bool elementtoint(Arc::XMLNode pnode, const char *ename, T &val)
Helper method for processing element value.
Definition: ArcConfig.h:90
void AddOToken(const std::string &token)
Add authentication token.
void AddPrivateKey(const std::string &path)
Add private key.
std::string cert
Path to certificate.
Definition: ArcConfig.h:117
void AddProxy(const std::string &path)
Add credentials proxy.
T stringto(const std::string &s)
This method converts a string to any type.
Definition: StringConv.h:22
Configuration element - represents (sub)tree of ARC XML configuration.
Definition: ArcConfig.h:26
virtual XMLNode MakeConfig(XMLNode cfg) const
Adds plugin configuration into common configuration tree supplied in 'cfg' argument.
BaseConfig()
Construct new BaseConfig. Plugin paths are determined automatically.
XMLNode overlay
Configuration overlay.
Definition: ArcConfig.h:127
void AddCAFile(const std::string &path)
Add CA file.