paludis Version 3.0.2
The one true package mangler
Strings

Files

file  /var/tmp/paludis/build/sys-apps-paludis-scm-r1/work/paludis-scm/paludis/util/destringify.hh
file  /var/tmp/paludis/build/sys-apps-paludis-scm-r1/work/paludis-scm/paludis/util/join.hh
file  /var/tmp/paludis/build/sys-apps-paludis-scm-r1/work/paludis-scm/paludis/util/stringify.hh
file  /var/tmp/paludis/build/sys-apps-paludis-scm-r1/work/paludis-scm/paludis/util/strip.hh
file  /var/tmp/paludis/build/sys-apps-paludis-scm-r1/work/paludis-scm/paludis/util/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::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

  • None at this time.

Function Documentation

◆ destringify()

template<typename Type_, typename Exception_ = DestringifyError>
Type_ paludis::destringify ( const std::string & s)

Extract a value of some type from a string.

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

Referenced by destringify().

◆ join() [1/4]

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

◆ join() [2/4]

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

◆ join() [3/4]

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 join(), and stringify().

Referenced by join(), join(), join(), and join().

◆ join() [4/4]

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.

References join().

◆ real_stringify()

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

Referenced by real_stringify(), and paludis::stringify().

◆ stringify()

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_match_package.cc, example_name.cc, and example_package_id.cc.

References paludis::stringify_internals::real_stringify(), and stringify().

Referenced by join(), paludis::LogMessageHandler::operator<<(), and stringify().

◆ strip_leading()

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.

References PALUDIS_ATTRIBUTE, PALUDIS_VISIBLE, and strip_leading().

Referenced by strip_leading().

◆ strip_leading_string()

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.

References PALUDIS_ATTRIBUTE, PALUDIS_VISIBLE, and strip_leading_string().

Referenced by strip_leading_string().

◆ strip_trailing()

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.

References PALUDIS_ATTRIBUTE, PALUDIS_VISIBLE, and strip_trailing().

Referenced by strip_trailing().

◆ strip_trailing_string()

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.

References PALUDIS_ATTRIBUTE, PALUDIS_VISIBLE, and strip_trailing_string().

Referenced by strip_trailing_string().

◆ tokenise()

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

References tokenise().

Referenced by tokenise(), tokenise_whitespace(), and tokenise_whitespace_quoted().

◆ tokenise_whitespace()

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

Convenience function: tokenise on whitespace.

Since
0.26

References tokenise(), and tokenise_whitespace().

Referenced by tokenise_whitespace().

◆ tokenise_whitespace_quoted()

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

References tokenise(), and tokenise_whitespace_quoted().

Referenced by tokenise_whitespace_quoted().