Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template string_path

boost::property_tree::string_path — 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.

Synopsis

// In header: <boost/property_tree/string_path.hpp>

template<typename String, typename Translator> 
class string_path {
public:
  // types
  typedef  ; 
  typedef         ;

  // construct/copy/destruct
  ( = );
  (,  = ,  = );
  (,  = ,  = );
  (string_path &);
  string_path & (string_path &);

  // private member functions
   (();
   () ;

  // public member functions
   ();
   () ;
   () ;
   () ;
   () ;
  string_path & (string_path &);
};

Description

If instantiated with std::string and id_translator<std::string>, it accepts paths of the form "one.two.three.four".

Template Parameters

  1. typename String

    Any Sequence. If the sequence does not support random- access iteration, concatenation of paths assumes that insertions at the end preserve iterator validity.

  2. typename Translator

    A translator with internal_type == String.

string_path public construct/copy/destruct

  1. ( separator = );
    Create an empty path.
  2. ( value,  separator = ,  tr = );
    Create a path by parsing the given string.

    Parameters:

    separator

    The separator used in parsing. Defaults to '.'.

    tr

    The translator used by this path to convert the individual parts to keys.

    value

    A sequence, possibly with separators, that describes the path, e.g. "one.two.three".

  3. ( value,  separator = ,  tr = );
    Create a path by parsing the given string.

    Parameters:

    separator

    The separator used in parsing. Defaults to '.'.

    tr

    The translator used by this path to convert the individual parts to keys.

    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.

  4. (string_path & o);
  5. string_path & (string_path & o);

string_path private member functions

  1.  (();
  2.  () ;

string_path public member functions

  1.  ();
    Take a single element off the path at the front and return it.
  2.  () ;
    Test if the path is empty.
  3.  () ;
    Test if the path contains a single element, i.e. no separators.
  4.  () ;
    Get the separator used by this path.
  5.  () ;
  6. string_path & (string_path & o);
    Append a second path to this one.

    Requires:

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


PrevUpHomeNext