Container for a configuration. More...
#include <TsValue.h>
Public Types | |
typedef Configuration | self |
Self reference type. | |
Public Member Functions | |
bool | operator! () const |
Check if configuration is (not) valid. | |
operator detail::PseudoBool::Type () const | |
Check if the configuration is valid. | |
Value | getRoot () const |
Get the root Value of the configuration. | |
size_t | childCount () const |
Get the number of child values on the root value. | |
Value | operator[] (size_t idx) const |
Root value child access by index. | |
Value | operator[] (ConstBuffer const &name) const |
Root value child access by name. | |
Value | operator[] (char const *name) const |
Root value child access by name. | |
Value | find (char const *path) |
Find a value. | |
Buffer | alloc (size_t n) |
Allocate a local buffer of size n. | |
Static Public Member Functions | |
static Rv< self > | loadFromPath (char const *path) |
Load a configuration from a file. | |
Protected Attributes | |
detail::ValueTable | _table |
Table of values from the configuration. | |
Friends | |
class | Value |
Container for a configuration.
This is a wrapper class that holds a shared reference to a configuration.
Definition at line 346 of file TsValue.h.
Buffer ts::config::Configuration::alloc | ( | size_t | n | ) | [inline] |
Allocate a local buffer of size n.
This buffer will persist until the implementation instance is destroyed.
n | requested size of buffer. |
Definition at line 732 of file TsValue.h.
References _table, and ts::config::detail::ValueTable::alloc().
size_t ts::config::Configuration::childCount | ( | ) | const [inline] |
Get the number of child values on the root value.
Definition at line 733 of file TsValue.h.
References ts::config::Value::childCount(), and getRoot().
Value ts::config::Configuration::find | ( | char const * | path | ) | [inline] |
Find a value.
path | configuration path to value. |
Definition at line 731 of file TsValue.h.
References ts::config::Value::find(), and getRoot().
Value ts::config::Configuration::getRoot | ( | ) | const |
Get the root Value
of the configuration.
The root is always a group and has no name.
Definition at line 327 of file TsValue.cc.
References _table, ts::config::detail::ValueTable::forceRootItem(), and Value.
Referenced by ts::config::Builder::build(), childCount(), find(), operator[](), and ts::config::Value::operator[]().
Rv< Configuration > ts::config::Configuration::loadFromPath | ( | char const * | path | ) | [static] |
Load a configuration from a file.
Configuration
and errata. path | file system path. |
Definition at line 333 of file TsValue.cc.
References _fileno, ts::Buffer::_ptr, ts::Buffer::_size, ts::msg::logf_errno(), ts::Rv< R >::result(), and ts::msg::WARN.
ts::config::Configuration::operator detail::PseudoBool::Type | ( | ) | const [inline] |
bool ts::config::Configuration::operator! | ( | ) | const [inline] |
Value ts::config::Configuration::operator[] | ( | char const * | name | ) | const [inline] |
Value ts::config::Configuration::operator[] | ( | ConstBuffer const & | name | ) | const [inline] |
Value ts::config::Configuration::operator[] | ( | size_t | idx | ) | const [inline] |
detail::ValueTable ts::config::Configuration::_table [protected] |
Table of values from the configuration.
Definition at line 412 of file TsValue.h.
Referenced by alloc(), ts::config::Value::getParent(), getRoot(), ts::config::Value::getText(), ts::config::Value::getType(), ts::config::Value::item(), ts::config::Value::makeChild(), ts::config::Value::makePath(), operator detail::PseudoBool::Type(), operator!(), and ts::config::Value::operator[]().