Ocean
|
This class implements a configuration value. More...
Public Member Functions | |
virtual ValueType | type () const |
Returns the type of this value. More... | |
virtual bool | isMultiType () const |
Returns whether this value holds a multi type. More... | |
virtual unsigned int | values () const |
Returns the number of sub values. More... | |
virtual unsigned int | values (const std::string &name) const |
Returns the number of sub values with a given name. More... | |
virtual bool | exist (const std::string &name) const |
Returns whether this value holds at least one specified sub value. More... | |
virtual Value & | value (const std::string &name, const unsigned int index=0u) |
Returns a sub value specified by it's name and it's index if more than one value exists with the same name. More... | |
virtual bool | value (const std::string &name, const unsigned int index, Value **value) |
Returns a sub value specified by it's name and it's index if more than one value exists with the same name. More... | |
virtual Value & | value (const unsigned int index, std::string &name) |
Returns a sub value specified by it's index. More... | |
virtual bool | value (const unsigned int index, std::string &name, Value **value) |
Returns a sub value specified by it's index. More... | |
virtual Value & | add (const std::string &name) |
Adds a new sub value specified by it's name. More... | |
virtual bool | operator() (const bool value) const |
Returns this value as boolean. More... | |
virtual int | operator() (const int value) const |
Returns this value as integer. More... | |
virtual double | operator() (const double value) const |
Returns this value as number. More... | |
std::string | operator() (const char *value) const |
Returns this value as string. More... | |
virtual std::string | operator() (const std::string &value) const |
Returns this value as string. More... | |
virtual std::vector< bool > | operator() (const std::vector< bool > &value) const |
Returns this value as multi boolean. More... | |
virtual std::vector< int > | operator() (const std::vector< int > &value) const |
Returns this value as multi integer. More... | |
virtual std::vector< double > | operator() (const std::vector< double > &value) const |
Returns this value as multi number. More... | |
virtual std::vector< std::string > | operator() (const std::vector< std::string > &value) const |
Returns this value as multi string. More... | |
virtual bool | operator= (const bool value) |
Sets this value as boolean. More... | |
virtual bool | operator= (const int value) |
Sets this value as integer. More... | |
virtual bool | operator= (const double value) |
Sets this value as number. More... | |
bool | operator= (const char *value) |
Sets this value as string. More... | |
virtual bool | operator= (const std::string &value) |
Sets this value as string. More... | |
virtual bool | operator= (const std::vector< bool > &values) |
Sets this value as multi boolean. More... | |
virtual bool | operator= (const std::vector< int > &values) |
Sets this value as multi integer. More... | |
virtual bool | operator= (const std::vector< double > &values) |
Sets this value as multi number. More... | |
virtual bool | operator= (const std::vector< std::string > &values) |
Sets this value as multi string. More... | |
virtual Value & | operator[] (const std::string &name) |
Returns the first sub value specified by it's name or creates a new value if no existing. More... | |
Protected Member Functions | |
Value ()=default | |
Creates a new value object. More... | |
Value (const Value &value)=default | |
Default copy constructor. More... | |
virtual | ~Value ()=default |
Destructs a value object. More... | |
Protected Attributes | |
ValueType | valueType_ = TYPE_INVALID |
Value type. More... | |
Friends | |
class | Config |
This class implements a configuration value.
Each value can represent a single parameter or a grouping object.
|
protecteddefault |
Creates a new value object.
|
protecteddefault |
Default copy constructor.
value | The value to copied |
|
protectedvirtualdefault |
Destructs a value object.
|
virtual |
Adds a new sub value specified by it's name.
name | The name of the sub value to create |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns whether this value holds at least one specified sub value.
name | The name of the sub value to check |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns whether this value holds a multi type.
|
virtual |
Returns this value as boolean.
value | Default value which will be returned if this value holds no boolean |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
inline |
Returns this value as string.
value | Default value which will be returned if this value holds no string |
|
virtual |
Returns this value as number.
value | Default value which will be returned if this value holds no number |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as integer.
value | Default value which will be returned if this value holds no integer |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as string.
value | Default value which will be returned if this value holds no string |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as multi boolean.
value | Default value which will be returned if this value holds no boolean |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as multi number.
value | Default value which will be returned if this value holds no number |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as multi integer.
value | Default value which will be returned if this value holds no integer |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns this value as multi string.
value | Default value which will be returned if this value holds no string |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as boolean.
value | The value to set |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
inline |
Sets this value as string.
value | The value to set |
|
virtual |
Sets this value as number.
value | The value to set |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as integer.
value | The value to set |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as string.
value | The value to set |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as multi boolean.
values | The values to set |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as multi number.
values | The values to set |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as multi integer.
values | The values to set |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Sets this value as multi string.
values | The values to set |
Reimplemented in Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns the first sub value specified by it's name or creates a new value if no existing.
name | The name of the sub-value to return |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns the type of this value.
|
virtual |
Returns a sub value specified by it's name and it's index if more than one value exists with the same name.
name | The name of the value to return |
index | The index within those sub values with the specified name |
value | Resulting sub value |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns a sub value specified by it's name and it's index if more than one value exists with the same name.
name | The name of the value to return |
index | The index within those sub values with the specified name |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns a sub value specified by it's index.
index | The index of the sub value to return |
name | Resulting name of the returning value |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns a sub value specified by it's index.
index | The index of the sub value to return |
name | Resulting name of the returning value |
value | Resulting sub value |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns the number of sub values.
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
virtual |
Returns the number of sub values with a given name.
name | The name of the sub values to return |
Reimplemented in Ocean::Platform::Win::RegistryConfig::RegistryValue, Ocean::IO::XMLConfig::XMLValue, Ocean::IO::JSONConfig::JSONValue, and Ocean::IO::FileConfig::FileValue.
|
friend |
|
protected |
Value type.