Claw  1.7.3
Namespaces | Functions
string_algorithm.hpp File Reference

Generic algorithms on strings. More...

#include <cstddef>
#include <claw/impl/string_algorithm.tpp>

Go to the source code of this file.

Namespaces

namespace  claw
 This is the main namespace.
namespace  claw::text
 Everything about text processing.

Functions

template<typename StreamType , typename StringType >
StreamType & claw::text::getline (StreamType &is, StringType &str)
 A portable version of std::getline( is, str, '\n' ) that removes a tailing '\r'.
template<typename StringType >
void claw::text::trim_left (StringType &str, const typename StringType::value_type *const s=" ")
 Remove characters at the begining of a string.
template<typename StringType >
void claw::text::trim_right (StringType &str, const typename StringType::value_type *const s=" ")
 Remove characters at the end of a string.
template<typename StringType >
void claw::text::trim (StringType &str, const typename StringType::value_type *const s=" ")
 Remove characters at the begining end at the end of a string.
template<typename StringType >
void claw::text::squeeze (StringType &str, const typename StringType::value_type *const s)
 Squeeze successive characters of a string into one character.
template<typename StringType >
std::size_t claw::text::replace (StringType &str, const StringType &e1, const StringType &e2)
 Replace a set of characters by other characters.
template<typename T , typename StringType >
bool claw::text::is_of_type (const StringType &str)
 Test if the content of a string is immediately convertible to a type.
template<typename Sequence >
void claw::text::split (Sequence &sequence, const typename Sequence::value_type &str, const typename Sequence::value_type::value_type sep)
 Split a string into several substrings, according to a given separator.
template<typename Sequence >
void claw::text::split (Sequence &sequence, typename Sequence::value_type::const_iterator first, typename Sequence::value_type::const_iterator last, const typename Sequence::value_type::value_type sep)
 Split a string into several substrings, according to a given separator.
template<typename InputIterator , typename OutputIterator >
void claw::text::c_escape (InputIterator first, InputIterator last, OutputIterator out)
 Find escaped symbols in a sequence of characters and replace them by their c-equivalent.
template<typename StringType >
bool claw::text::glob_match (const StringType &pattern, const StringType &text, const typename StringType::value_type any_sequence= '*', const typename StringType::value_type zero_or_one= '?', const typename StringType::value_type any= '.')
 Check if a string matches a given pattern.
template<typename StringType >
bool claw::text::glob_potential_match (const StringType &pattern, const StringType &text, const typename StringType::value_type any_sequence= '*', const typename StringType::value_type zero_or_one= '?', const typename StringType::value_type any= '.')
 Check if a string may match a given pattern.

Detailed Description

Generic algorithms on strings.

Author
Julien Jorge

Definition in file string_algorithm.hpp.