Strings
[Utilities]


Files

file  destringify.hh
file  join.hh
file  stringify.hh
file  strip.hh
file  tokeniser.hh

Namespaces

namespace  paludis::destringify_internals
namespace  paludis::stringify_internals
namespace  paludis::delim_kind
namespace  paludis::delim_mode
namespace  paludis::tokeniser_internals

Classes

class  paludis::DestringifyError
struct  paludis::destringify_internals::Destringifier< Type_, Exception_ >
struct  paludis::destringify_internals::Destringifier< std::string, Exception_ >
struct  paludis::destringify_internals::Destringifier< bool, Exception_ >
struct  paludis::destringify_internals::Destringifier< char, Exception_ >
struct  paludis::stringify_internals::CheckType< T_ >
struct  paludis::stringify_internals::CheckType< T_ * >
struct  paludis::stringify_internals::CheckType< std::tr1::shared_ptr< T_ > >
struct  paludis::stringify_internals::CheckType< char * >
struct  paludis::tokeniser_internals::Writer< delim_mode::DelimiterTag, Iter_ >
struct  paludis::tokeniser_internals::Writer< delim_mode::BoundaryTag, Iter_ >
class  paludis::TokeniserError

Functions

template<typename Type_, typename Exception_>
Type_ paludis::destringify (const std::string &s)
template<typename I_, typename T_>
T_ paludis::join (I_ i, I_ end, const T_ &joiner)
template<typename I_, typename T_, typename F_>
T_ paludis::join (I_ i, I_ end, const T_ &joiner, const F_ &f)
template<typename I_>
std::string paludis::join (I_ begin, const I_ end, const char *const t)
template<typename I_, typename F_>
std::string paludis::join (I_ begin, const I_ end, const char *const t, const F_ &f)
template<typename T_>
std::string paludis::stringify_internals::real_stringify (const T_ &item)
template<typename T_>
std::string paludis::stringify (const T_ &item)
std::string paludis::strip_leading_string (const std::string &s, const std::string &remove) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result))
std::string paludis::strip_leading (const std::string &s, const std::string &prefix) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result))
std::string paludis::strip_trailing_string (const std::string &s, const std::string &remove) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result))
std::string paludis::strip_trailing (const std::string &s, const std::string &suffix) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result))
template<typename DelimKind_, typename DelimMode_, typename Iter_>
void paludis::tokenise (const std::string &s, const std::string &delims, const std::string &quotes, Iter_ iter)
template<typename Iter_>
void paludis::tokenise_whitespace (const std::string &s, Iter_ iter)
template<typename Iter_>
void paludis::tokenise_whitespace_quoted (const std::string &s, Iter_ iter)

Detailed Description

We provide various functions and classes that simplify common string handling operations.

Examples


Function Documentation

template<typename Type_, typename Exception_>
Type_ paludis::destringify ( const std::string &  s  )  [inline]

Extract a value of some type from a string.

template<typename I_, typename F_>
std::string paludis::join ( I_  begin,
const I_  end,
const char *const   t,
const F_ &  f 
) [inline]

Convenience alternative join allowing a char * to be used for a string, using a function other than stringify.

Examples:
example_dep_spec_flattener.cc, example_metadata_key.cc, example_package_id.cc, and example_repository.cc.

template<typename I_>
std::string paludis::join ( I_  begin,
const I_  end,
const char *const   t 
) [inline]

Convenience alternative join allowing a char * to be used for a string.

template<typename I_, typename T_, typename F_>
T_ paludis::join ( I_  i,
I_  end,
const T_ &  joiner,
const F_ &  f 
) [inline]

Join together the items from i to end using joiner, using a function other than stringify.

template<typename I_, typename T_>
T_ paludis::join ( I_  i,
I_  end,
const T_ &  joiner 
) [inline]

Join together the items from i to end using joiner.

template<typename T_>
std::string paludis::stringify_internals::real_stringify ( const T_ &  item  )  [inline]

Internal function to convert item to a string, to make function pointers work more sensibly. May be overloaded, but should not be called directly.

template<typename T_>
std::string paludis::stringify ( const T_ &  item  )  [inline]

Convert item to a string. To customise for new types, overload stringify_internals::real_stringify, not this function.

Examples:
example_formatter.cc, example_match_package.cc, example_name.cc, example_package_id.cc, and example_stringify_formatter.cc.

std::string paludis::strip_leading ( const std::string &  s,
const std::string &  prefix 
)

Return a string equal to s minus any leading characters that are contained in prefix.

std::string paludis::strip_leading_string ( const std::string &  s,
const std::string &  remove 
)

Return a string equal to s, minus the string remove if remove occurs at the start of s.

std::string paludis::strip_trailing ( const std::string &  s,
const std::string &  suffix 
)

Return a string equal to s minus any trailing characters that are contained in suffix.

std::string paludis::strip_trailing_string ( const std::string &  s,
const std::string &  remove 
)

Return a string equal to s, minus the string remove if remove occurs at the end of s.

template<typename DelimKind_, typename DelimMode_, typename Iter_>
void paludis::tokenise ( const std::string &  s,
const std::string &  delims,
const std::string &  quotes,
Iter_  iter 
) [inline]

Tokenise a string.

Since:
0.26

template<typename Iter_>
void paludis::tokenise_whitespace ( const std::string &  s,
Iter_  iter 
) [inline]

Convenience function: tokenise on whitespace.

Since:
0.26

template<typename Iter_>
void paludis::tokenise_whitespace_quoted ( const std::string &  s,
Iter_  iter 
) [inline]

Convenience function: tokenise on whitespace, handling quoted strings.

Since:
0.26


Generated on Mon Sep 21 10:36:09 2009 for paludis by  doxygen 1.5.4