ARC SDK
|
Class representing "ini-style" configuration. More...
#include <arc/IniConfig.h>
Public Member Functions | |
IniConfig () | |
Dummy constructor. More... | |
IniConfig (const std::string &filename) | |
Read configuration from specified filename. More... | |
bool | Evaluate (Config &cfg) |
Evaluate configuration against the standard profile. More... | |
![]() | |
XMLNode (void) | |
Constructor of invalid node. More... | |
XMLNode (const XMLNode &node) | |
Copies existing instance. More... | |
XMLNode (const std::string &xml) | |
Creates XML document structure from textual representation of XML document. More... | |
XMLNode (const char *xml, int len=-1) | |
Creates XML document structure from textual representation of XML document. More... | |
XMLNode (long ptr_addr) | |
Copy constructor. Used by language bindings. More... | |
XMLNode (const NS &ns, const char *name) | |
Creates empty XML document structure with specified namespaces. More... | |
~XMLNode (void) | |
Destructor. More... | |
void | New (XMLNode &node) const |
Creates a copy of XML (sub)tree. More... | |
void | Exchange (XMLNode &node) |
Exchanges XML (sub)trees. More... | |
void | Move (XMLNode &node) |
Moves content of this XML (sub)tree to node. More... | |
void | Swap (XMLNode &node) |
Swaps XML (sub)trees to which this and node refer. More... | |
operator bool (void) const | |
Returns true if instance points to XML element - valid instance. More... | |
bool | operator! (void) const |
Returns true if instance does not point to XML element - invalid instance. More... | |
bool | operator== (const XMLNode &node) |
Returns true if 'node' represents same XML element. More... | |
bool | operator!= (const XMLNode &node) |
Returns false if 'node' represents same XML element. More... | |
bool | Same (const XMLNode &node) |
Returns true if 'node' represents same XML element - for bindings. More... | |
bool | operator== (bool val) |
This operator is needed to avoid ambiguity. More... | |
bool | operator!= (bool val) |
This operator is needed to avoid ambiguity. More... | |
bool | operator== (const std::string &str) |
This operator is needed to avoid ambiguity. More... | |
bool | operator!= (const std::string &str) |
This operator is needed to avoid ambiguity. More... | |
bool | operator== (const char *str) |
This operator is needed to avoid ambiguity. More... | |
bool | operator!= (const char *str) |
This operator is needed to avoid ambiguity. More... | |
XMLNode | Child (int n=0) |
Returns XMLNode instance representing n-th child of XML element. More... | |
XMLNode | operator[] (const char *name) const |
Returns XMLNode instance representing first child element with specified name. More... | |
XMLNode | operator[] (const std::string &name) const |
Returns XMLNode instance representing first child element with specified name. More... | |
XMLNode | operator[] (int n) const |
Returns XMLNode instance representing n-th node in sequence of siblings of same name. More... | |
void | operator++ (void) |
Convenience operator to switch to next element of same name. More... | |
void | operator-- (void) |
Convenience operator to switch to previous element of same name. More... | |
int | Size (void) const |
Returns number of children nodes. More... | |
XMLNode | Get (const std::string &name) const |
Same as operator[](). More... | |
std::string | Name (void) const |
Returns name of XML node. More... | |
std::string | Prefix (void) const |
Returns namespace prefix of XML node. More... | |
std::string | FullName (void) const |
Returns prefix:name of XML node. More... | |
std::string | Namespace (void) const |
Returns namespace URI of XML node. More... | |
void | Prefix (const std::string &prefix, int recursion=0) |
Assigns namespace prefix to XML node(s). More... | |
void | StripNamespace (int recursion=0) |
Removes namespace prefix from XML node(s). More... | |
void | Name (const char *name) |
Assigns new name to XML node. More... | |
void | Name (const std::string &name) |
Assigns new name to XML node. More... | |
void | GetXML (std::string &out_xml_str, bool user_friendly=false) const |
Fills argument with this instance XML subtree textual representation. More... | |
void | GetXML (std::string &out_xml_str, const std::string &encoding, bool user_friendly=false) const |
Get string representation of XML subtree. More... | |
void | GetDoc (std::string &out_xml_str, bool user_friendly=false) const |
Fills out_xml_str with whole XML document textual representation. More... | |
operator std::string (void) const | |
Returns textual content of node excluding content of children nodes. More... | |
XMLNode & | operator= (const char *content) |
Sets textual content of node. All existing children nodes are discarded. More... | |
XMLNode & | operator= (const std::string &content) |
Sets textual content of node. All existing children nodes are discarded. More... | |
void | Set (const std::string &content) |
Same as operator=. Used for bindings. More... | |
XMLNode & | operator= (const XMLNode &node) |
Make instance refer to another XML node. Ownership is not inherited. More... | |
XMLNode | Attribute (int n=0) |
Returns XMLNode instance reresenting n-th attribute of node. More... | |
XMLNode | Attribute (const char *name) |
Returns XMLNode instance representing first attribute of node with specified by name. More... | |
XMLNode | Attribute (const std::string &name) |
Returns XMLNode instance representing first attribute of node with specified by name. More... | |
XMLNode | NewAttribute (const char *name) |
Creates new attribute with specified name. More... | |
XMLNode | NewAttribute (const std::string &name) |
Creates new attribute with specified name. More... | |
int | AttributesSize (void) const |
Returns number of attributes of node. More... | |
void | Namespaces (const NS &namespaces, bool keep=false, int recursion=-1) |
Assigns namespaces of XML document at point specified by this instance. More... | |
NS | Namespaces (void) |
Returns namespaces known at this node. More... | |
std::string | NamespacePrefix (const char *urn) |
Returns prefix of specified namespace or empty string if no such namespace. More... | |
XMLNode | NewChild (const char *name, int n=-1, bool global_order=false) |
Creates new child XML element at specified position with specified name. More... | |
XMLNode | NewChild (const std::string &name, int n=-1, bool global_order=false) |
Same as NewChild(const char*,int,bool). More... | |
XMLNode | NewChild (const char *name, const NS &namespaces, int n=-1, bool global_order=false) |
Creates new child XML element at specified position with specified name and namespaces. More... | |
XMLNode | NewChild (const std::string &name, const NS &namespaces, int n=-1, bool global_order=false) |
Same as NewChild(const char*,const NS&,int,bool). More... | |
XMLNode | NewChild (const XMLNode &node, int n=-1, bool global_order=false) |
Link a copy of supplied XML node as child. More... | |
void | Replace (const XMLNode &node) |
Makes a copy of supplied XML node and makes this instance refer to it. More... | |
void | Destroy (void) |
Destroys underlying XML element. More... | |
XMLNodeList | Path (const std::string &path) |
Collects nodes corresponding to specified path. More... | |
XMLNodeList | XPathLookup (const std::string &xpathExpr, const NS &nsList) |
Uses XPath to look up XML tree. More... | |
XMLNode | GetRoot (void) |
Get the root node from any child node of the tree. More... | |
XMLNode | Parent (void) |
Get the parent node from any child node of the tree. More... | |
bool | SaveToFile (const std::string &file_name) const |
Save string representation of node to file. More... | |
bool | SaveToStream (std::ostream &out) const |
Save string representation of node to stream. More... | |
bool | ReadFromFile (const std::string &file_name) |
Read XML document from file and associate it with this node. More... | |
bool | ReadFromStream (std::istream &in) |
Read XML document from stream and associate it with this node. More... | |
bool | Validate (const std::string &schema_file, std::string &err_msg) |
XML schema validation against the schema file defined as argument. More... | |
bool | Validate (XMLNode schema_doc, std::string &err_msg) |
Additional Inherited Members | |
![]() | |
XMLNode (xmlNodePtr node) | |
Protected constructor for inherited classes. More... | |
bool | Validate (xmlSchemaPtr schema, std::string &err_msg) |
![]() | |
static void | LogError (void *ctx, const char *msg,...) |
![]() | |
xmlNodePtr | node_ |
bool | is_owner_ |
If true node is owned by this instance - hence released in destructor. More... | |
bool | is_temporary_ |
This variable is reserved for future use. More... | |
Class representing "ini-style" configuration.
It provides a way to convert configuration to XML for use with HED internally.
|
inline |
Dummy constructor.
Arc::IniConfig::IniConfig | ( | const std::string & | filename | ) |
Read configuration from specified filename.
bool Arc::IniConfig::Evaluate | ( | Config & | cfg | ) |
Evaluate configuration against the standard profile.