paludis  Version 2.6.0
Files | Namespaces | Classes | Functions
Strings

Files

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

Namespaces

 paludis::destringify_internals
 
 paludis::stringify_internals
 
 paludis::delim_kind
 
 paludis::delim_mode
 
 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::shared_ptr< T_ > >
 
struct  paludis::stringify_internals::CheckType< char * >
 
struct  paludis::tokeniser_internals::Writer< DelimMode_, Iter_ >
 
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_ = DestringifyError>
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_ = DestringifyError>
Type_ paludis::destringify ( const std::string &  s)

Extract a value of some type from a string.

References paludis::destringify_internals::Destringifier< Type_, Exception_ >::do_destringify().

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

Join together the items from i to end using joiner.

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

References paludis::stringify().

Referenced by paludis::join().

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

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

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

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

References paludis::join().

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

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

References paludis::join().

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

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

References PALUDIS_ATTRIBUTE, and paludis::stringify().

Referenced by paludis::stringify().

template<typename T_ >
std::string paludis::stringify ( const T_ &  item)
inline
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 
)

Tokenise a string.

Since
0.26
template<typename Iter_ >
void paludis::tokenise_whitespace ( const std::string &  s,
Iter_  iter 
)

Convenience function: tokenise on whitespace.

Since
0.26
template<typename Iter_ >
void paludis::tokenise_whitespace_quoted ( const std::string &  s,
Iter_  iter 
)

Convenience function: tokenise on whitespace, handling quoted strings.

Since
0.26