Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::property_tree::string_path< String, Translator > Class Template Reference

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_pathoperator= (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_pathoperator/= (const string_path &o)
 Append a second path to this one. More...
 

Detailed Description

template<typename String, typename Translator>
class boost::property_tree::string_path< String, Translator >

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".

Template Parameters
StringAny Sequence. If the sequence does not support random- access iteration, concatenation of paths assumes that insertions at the end preserve iterator validity.
TranslatorA translator with internal_type == String.

Member Typedef Documentation

template<typename String , typename Translator >
typedef String::value_type boost::property_tree::string_path< String, Translator >::char_type
template<typename String , typename Translator >
typedef Translator::external_type boost::property_tree::string_path< String, Translator >::key_type

Constructor & Destructor Documentation

template<typename String , typename Translator >
boost::property_tree::string_path< String, Translator >::string_path ( char_type  separator = char_type('.'))
inlineexplicit

Create an empty path.

template<typename String , typename Translator >
boost::property_tree::string_path< String, Translator >::string_path ( const String &  value,
char_type  separator = char_type('.'),
Translator  tr = Translator() 
)
inline

Create a path by parsing the given string.

Parameters
valueA sequence, possibly with separators, that describes the path, e.g. "one.two.three".
separatorThe separator used in parsing. Defaults to '.'.
trThe translator used by this path to convert the individual parts to keys.
template<typename String , typename Translator >
boost::property_tree::string_path< String, Translator >::string_path ( const char_type value,
char_type  separator = char_type('.'),
Translator  tr = Translator() 
)
inline

Create a path by parsing the given string.

Parameters
valueA 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.
separatorThe separator used in parsing. Defaults to '.'.
trThe translator used by this path to convert the individual parts to keys.
template<typename String , typename Translator >
boost::property_tree::string_path< String, Translator >::string_path ( const string_path< String, Translator > &  o)
inline

Member Function Documentation

template<typename String , typename Translator >
std::string boost::property_tree::string_path< String, Translator >::dump ( ) const
inline
template<typename String , typename Translator >
bool boost::property_tree::string_path< String, Translator >::empty ( void  ) const
inline
template<typename String , typename Translator >
string_path& boost::property_tree::string_path< String, Translator >::operator/= ( const string_path< String, Translator > &  o)
inline

Append a second path to this one.

Precondition
o's separator is the same as this one's, or o has no separators

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().

template<typename String , typename Translator >
string_path< String, Translator > & boost::property_tree::string_path< String, Translator >::operator= ( const string_path< String, Translator > &  o)
inline
template<typename String , typename Translator >
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().

template<typename String , typename Translator >
char_type boost::property_tree::string_path< String, Translator >::separator ( ) const
inline

Get the separator used by this path.

template<typename String , typename Translator >
bool boost::property_tree::string_path< String, Translator >::single ( ) const
inline

Test if the path contains a single element, i.e. no separators.

References boost::algorithm::find().


The documentation for this class was generated from the following files: