Default path class. More...
#include <string_path.hpp>
Public Types | |
typedef Translator::external_type | key_type |
typedef String::value_type | char_type |
Public Member Functions | |
string_path (char_type separator=char_type('.')) | |
Create an empty path. More... | |
string_path (const String &value, char_type separator=char_type('.'), Translator tr=Translator()) | |
Create a path by parsing the given string. More... | |
string_path (const char_type *value, char_type separator=char_type('.'), Translator tr=Translator()) | |
Create a path by parsing the given string. More... | |
string_path (const string_path &o) | |
string_path & | operator= (const string_path &o) |
key_type | reduce () |
Take a single element off the path at the front and return it. More... | |
bool | empty () const |
Test if the path is empty. More... | |
bool | single () const |
Test if the path contains a single element, i.e. no separators. More... | |
char_type | separator () const |
Get the separator used by this path. More... | |
std::string | dump () const |
string_path & | operator/= (const string_path &o) |
Append a second path to this one. More... | |
Default path class.
A path is a sequence of values. Groups of values are separated by the separator value, which defaults to '.' cast to the sequence's value type. The group of values is then passed to the translator to get a key.
If instantiated with std::string and id_translator<std::string>, it accepts paths of the form "one.two.three.four".
String | Any Sequence. If the sequence does not support random- access iteration, concatenation of paths assumes that insertions at the end preserve iterator validity. |
Translator | A translator with internal_type == String. |
typedef String::value_type boost::property_tree::string_path< String, Translator >::char_type |
typedef Translator::external_type boost::property_tree::string_path< String, Translator >::key_type |
|
inlineexplicit |
Create an empty path.
|
inline |
Create a path by parsing the given string.
value | A sequence, possibly with separators, that describes the path, e.g. "one.two.three". |
separator | The separator used in parsing. Defaults to '.'. |
tr | The translator used by this path to convert the individual parts to keys. |
|
inline |
Create a path by parsing the given string.
value | A zero-terminated array of values. Only use if zero- termination makes sense for your type, and your sequence supports construction from it. Intended for string literals. |
separator | The separator used in parsing. Defaults to '.'. |
tr | The translator used by this path to convert the individual parts to keys. |
|
inline |
References boost::fusion::advance(), and boost::fusion::distance().
|
inline |
References boost::property_tree::detail::dump_sequence().
|
inline |
Test if the path is empty.
Referenced by boost::property_tree::string_path< String, Translator >::operator/=().
|
inline |
Append a second path to this one.
References boost::property_tree::detail::append_and_preserve_iter(), BOOST_ASSERT, boost::property_tree::string_path< String, Translator >::empty(), and boost::numeric::interval_lib::sub().
|
inline |
References boost::fusion::advance(), and boost::fusion::distance().
Translator::external_type boost::property_tree::string_path< String, Translator >::reduce | ( | ) |
Take a single element off the path at the front and return it.
References BOOST_ASSERT, BOOST_PROPERTY_TREE_THROW, boost::empty(), and boost::algorithm::find().
|
inline |
Get the separator used by this path.
|
inline |
Test if the path contains a single element, i.e. no separators.
References boost::algorithm::find().