8#ifndef META_OCEAN_IO_XML_CONFIG_H
9#define META_OCEAN_IO_XML_CONFIG_H
66 unsigned int values() const override;
72 unsigned int values(const std::
string& name) const override;
78 bool exist(const std::
string& name) const override;
84 XMLValue&
value(const std::
string& name, const
unsigned int index) override;
90 bool value(const std::
string& name, const
unsigned int index,
Value**
value) override;
122 bool operator()(const
bool value) const override;
128 int operator()(const
int value) const override;
134 double operator()(const
double value) const override;
140 std::
string operator()(const std::
string&
value) const override;
146 std::vector<
bool> operator()(const std::vector<
bool>&
value) const override;
152 std::vector<
int> operator()(const std::vector<
int>&
value) const override;
158 std::vector<
double> operator()(const std::vector<
double>&
value) const override;
170 bool operator=(const
bool value) override;
176 bool operator=(const
int value) override;
182 bool operator=(const
double value) override;
188 bool operator=(const std::
string&
value) override;
194 bool operator=(const std::vector<
bool>&
values) override;
200 bool operator=(const std::vector<
int>&
values) override;
206 bool operator=(const std::vector<
double>&
values) override;
218 XMLValue& operator[](const std::
string& name) override;
224 explicit operator
bool() const;
285 inline const std::
string&
filename() const;
318 unsigned int values(const std::
string& name) const override;
324 bool exist(const std::
string& name) const override;
342 XMLValue&
value(const std::
string& name, const
unsigned int index) override;
348 bool value(const std::
string& name, const
unsigned int index,
Value**
value) override;
361 XMLValue& operator[](const std::
string& name) override;
This class implements a configuration value.
Definition Config.h:77
Value()=default
Creates a new value object.
Config()
Creates a new configuration toolkit.
Definition of a file value object.
Definition XMLConfig.h:47
XMLConfig * xmlConfig_
Main config object.
Definition XMLConfig.h:247
bool exist(const std::string &name) const override
Returns whether this value holds at least one specified sub value.
XMLValue & add(const std::string &name) override
Adds a new sub value specified by it's name.
~XMLValue() final
Destructs a value object.
tinyxml2::XMLNode * xmlNode_
XML node.
Definition XMLConfig.h:244
XMLValue & value(const std::string &name, const unsigned int index) override
Returns a sub value specified by it's name and it's index if more than one value exists with the same...
XMLValue(XMLConfig *config, tinyxml2::XMLNode *node)
Creates a new value object.
unsigned int values() const override
Returns the number of sub values.
std::string attribute(const std::string &name) const
Returns the value of a specified attribute of this value.
friend class XMLConfig
Definition XMLConfig.h:48
XMLConfig()
Creates a new config object.
std::ifstream inputFileStream_
The input file stream which is used if a filename is specified.
Definition XMLConfig.h:406
bool write() override
Writes / saves all values of this configuration.
std::string filename_
Filename of this config object.
Definition XMLConfig.h:400
bool exist(const std::string &name) const override
Returns whether this value holds at least one specified sub value.
static XMLValue & nullValue()
Returns the default value holding no data.
std::unique_ptr< tinyxml2::XMLDocument > xmlDocument_
XML parser.
Definition XMLConfig.h:394
XMLValue & value(const unsigned int index, std::string &name) override
Returns a sub value specified by it's index.
const std::string & filename() const
Returns the config file.
Definition XMLConfig.h:409
bool isEmpty() const
Returns whether this file configuration container does not hold any values.
std::vector< std::unique_ptr< XMLValue > > XMLValues
Definition of a vector holding values.
Definition XMLConfig.h:253
XMLValues xmlIntermediateValues_
XML values.
Definition XMLConfig.h:397
bool setFilename(const std::string &filename, const bool read=true)
Sets the filename of the new config objects.
bool read() override
Reads / loads all values of this configuration.
XMLValue & add(const std::string &name) override
Adds a new sub value specified by it's name.
static const tinyxml2::XMLText * firstText(const tinyxml2::XMLNode *xmlNode)
Returns the first text node connected with a given node.
unsigned int values() const override
Returns the number of sub values.
std::istream & inputStream_
The input stream.
Definition XMLConfig.h:403
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
The namespace covering the entire Ocean framework.
Definition Accessor.h:15
Definition XMLConfig.h:19