library of assembled shared sources

http://lass.cocamware.com

Extended_string

extra std::string functionality More...


Functions

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::tolower (const std::basic_string< Char, Traits, Alloc > &input, const std::locale &locale)
 convert std::basic_string to lower case by using user locale
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::toupper (const std::basic_string< Char, Traits, Alloc > &input, const std::locale &locale)
 convert std::basic_string to upper case by using user locale
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::replace_all (const std::basic_string< Char, Traits, Alloc > &input, const std::basic_string< Char, Traits, Alloc > &to_be_replaced, const std::basic_string< Char, Traits, Alloc > &replacement)
 replace all instances of to_be_replaced in input by replacement.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::replace_all (const std::basic_string< Char, Traits, Alloc > &input, const Char *to_be_replaced, const Char *replacement)
 replace all instances of to_be_replaced in input by replacement.
template<typename Char , typename Traits , typename Alloc >
bool lass::stde::begins_with (const std::basic_string< Char, Traits, Alloc > &input, const std::basic_string< Char, Traits, Alloc > &prefix)
 returns true if input begins with the input prefix
template<typename Char , typename Traits , typename Alloc >
bool lass::stde::begins_with (const std::basic_string< Char, Traits, Alloc > &input, const Char *prefix)
 returns true if input begins with the input prefix
template<typename Char , typename Traits , typename Alloc >
bool lass::stde::ends_with (const std::basic_string< Char, Traits, Alloc > &input, const std::basic_string< Char, Traits, Alloc > &suffix)
 returns true if input ends with the input suffix
template<typename Char , typename Traits , typename Alloc >
bool lass::stde::ends_with (const std::basic_string< Char, Traits, Alloc > &input, const Char *suffix)
 returns true if input ends with the input suffix
template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string
< Char, Traits, Alloc > > 
lass::stde::split (const std::basic_string< Char, Traits, Alloc > &to_be_split)
 Reflects the Python function split without seperator argument.
template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string
< Char, Traits, Alloc > > 
lass::stde::split (const std::basic_string< Char, Traits, Alloc > &to_be_split, const std::basic_string< Char, Traits, Alloc > &seperator, size_t max_split)
 Reflects the Python function split without seperator argument.
template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string
< Char, Traits, Alloc > > 
lass::stde::split (const std::basic_string< Char, Traits, Alloc > &to_be_split, const Char *seperator, size_t max_split)
 Reflects the Python function split without seperator argument.
template<typename Char , typename Traits , typename Alloc , typename InputIterator >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::join (const std::basic_string< Char, Traits, Alloc > &joiner, InputIterator first, InputIterator last)
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::lstrip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped, const std::basic_string< Char, Traits, Alloc > &to_be_removed)
 Return a copy of the string to_be_stripped with leading characters removed.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::lstrip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped)
 Return a copy of the string to_be_stripped with leading whitespace removed.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::rstrip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped, const std::basic_string< Char, Traits, Alloc > &to_be_removed)
 Return a copy of the string to_be_stripped with trailing characters removed.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::rstrip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped)
 Return a copy of the string to_be_stripped with trailing whitespace removed.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::strip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped, const std::basic_string< Char, Traits, Alloc > &to_be_removed)
 Return a copy of the string to_be_stripped with both leading and trailing characters removed.
template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char,
Traits, Alloc > 
lass::stde::strip (const std::basic_string< Char, Traits, Alloc > &to_be_stripped)
 Return a copy of the string to_be_stripped with leading and trailing whitespace removed.


Detailed Description

extra std::string functionality

Author:
Bram de Greve [BdG]
ExtendedString is not an extended std::string implementation as the name might suggest, but a set of functions that provide extra functionality on very standard std::string strings. Most of them are inspired by the string module of Python, as you will notice. Others are std::string implementations of C functions operating on char arrays

Function Documentation

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::tolower ( const std::basic_string< Char, Traits, Alloc > &  input,
const std::locale &  locale = std::locale() 
) [inline]

convert std::basic_string to lower case by using user locale

Definition at line 63 of file extended_string.inl.

Referenced by lass::io::Image::findFormat().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::toupper ( const std::basic_string< Char, Traits, Alloc > &  input,
const std::locale &  locale = std::locale() 
) [inline]

convert std::basic_string to upper case by using user locale

Definition at line 82 of file extended_string.inl.

Referenced by lass::io::Image::HeaderRadianceHdr::readFrom().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::replace_all ( const std::basic_string< Char, Traits, Alloc > &  input,
const std::basic_string< Char, Traits, Alloc > &  to_be_replaced,
const std::basic_string< Char, Traits, Alloc > &  replacement 
) [inline]

replace all instances of to_be_replaced in input by replacement.

Definition at line 99 of file extended_string.inl.

Referenced by lass::stde::replace_all().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::replace_all ( const std::basic_string< Char, Traits, Alloc > &  input,
const Char *  to_be_replaced,
const Char *  replacement 
) [inline]

replace all instances of to_be_replaced in input by replacement.

Definition at line 122 of file extended_string.inl.

References lass::stde::replace_all().

template<typename Char , typename Traits , typename Alloc >
bool lass::stde::begins_with ( const std::basic_string< Char, Traits, Alloc > &  input,
const std::basic_string< Char, Traits, Alloc > &  prefix 
) [inline]

returns true if input begins with the input prefix

Definition at line 135 of file extended_string.inl.

Referenced by lass::stde::begins_with(), lass::io::fileJoinExtension(), and lass::io::Image::HeaderRadianceHdr::readFrom().

template<typename Char , typename Traits , typename Alloc >
bool lass::stde::begins_with ( const std::basic_string< Char, Traits, Alloc > &  input,
const Char *  prefix 
) [inline]

returns true if input begins with the input prefix

Definition at line 145 of file extended_string.inl.

References lass::stde::begins_with().

template<typename Char , typename Traits , typename Alloc >
bool lass::stde::ends_with ( const std::basic_string< Char, Traits, Alloc > &  input,
const std::basic_string< Char, Traits, Alloc > &  suffix 
) [inline]

returns true if input ends with the input suffix

Definition at line 157 of file extended_string.inl.

Referenced by lass::stde::ends_with(), and lass::io::fileJoinPath().

template<typename Char , typename Traits , typename Alloc >
bool lass::stde::ends_with ( const std::basic_string< Char, Traits, Alloc > &  input,
const Char *  suffix 
) [inline]

returns true if input ends with the input suffix

Definition at line 168 of file extended_string.inl.

References lass::stde::ends_with().

template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string< Char, Traits, Alloc > > lass::stde::split ( const std::basic_string< Char, Traits, Alloc > &  to_be_split  )  [inline]

Reflects the Python function split without seperator argument.

Return a vector of the words of the string to_be_split. The words are separated by arbitrary strings of whitespace characters (space, tab, newline, return, formfeed).

If to_be_split is empty, then the result will have an empty vector.

Definition at line 186 of file extended_string.inl.

References lass::stde::impl::whitespace().

Referenced by lass::stde::split().

template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string< Char, Traits, Alloc > > lass::stde::split ( const std::basic_string< Char, Traits, Alloc > &  to_be_split,
const std::basic_string< Char, Traits, Alloc > &  seperator,
size_t  max_split 
) [inline]

Reflects the Python function split without seperator argument.

Return a vector of the words of the string to_be_split. The second argument seperator specifies a string to be used as the word separator. The returned vector will then have one more item than the number of non-overlapping occurrences of the separator in the string.

The optional third argument max_split defaults to 0. If it is nonzero, at most max_split number of splits occur, and the remainder of the string is returned as the final element of the list (thus, the list will have at most max_split + 1 elements).

If to_be_split is empty, then the result will have an empty string as only element.

Definition at line 234 of file extended_string.inl.

template<typename Char , typename Traits , typename Alloc >
std::vector< std::basic_string< Char, Traits, Alloc > > lass::stde::split ( const std::basic_string< Char, Traits, Alloc > &  to_be_split,
const Char *  seperator,
size_t  max_split = 0 
) [inline]

template<typename Char , typename Traits , typename Alloc , typename InputIterator >
std::basic_string< Char, Traits, Alloc > lass::stde::join ( const std::basic_string< Char, Traits, Alloc > &  joiner,
InputIterator  first,
InputIterator  last 
) [inline]

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::lstrip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped,
const std::basic_string< Char, Traits, Alloc > &  to_be_removed 
) [inline]

Return a copy of the string to_be_stripped with leading characters removed.

The characters in the string to_be_removed will be stripped from the beginning of the string to_be_stripped.

Definition at line 317 of file extended_string.inl.

Referenced by lass::stde::lstrip().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::lstrip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped  )  [inline]

Return a copy of the string to_be_stripped with leading whitespace removed.

Definition at line 332 of file extended_string.inl.

References lass::stde::lstrip(), and lass::stde::impl::whitespace().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::rstrip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped,
const std::basic_string< Char, Traits, Alloc > &  to_be_removed 
) [inline]

Return a copy of the string to_be_stripped with trailing characters removed.

The characters in the string to_be_removed will be stripped from the ending of the string to_be_stripped.

Definition at line 347 of file extended_string.inl.

Referenced by lass::stde::impl::value_traits::cast(), and lass::stde::rstrip().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::rstrip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped  )  [inline]

Return a copy of the string to_be_stripped with trailing whitespace removed.

Definition at line 362 of file extended_string.inl.

References lass::stde::rstrip(), and lass::stde::impl::whitespace().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::strip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped,
const std::basic_string< Char, Traits, Alloc > &  to_be_removed 
) [inline]

Return a copy of the string to_be_stripped with both leading and trailing characters removed.

The characters in the string to_be_removed will be stripped from both the beginning and the ending of the string to_be_stripped.

Definition at line 377 of file extended_string.inl.

Referenced by lass::stde::strip().

template<typename Char , typename Traits , typename Alloc >
std::basic_string< Char, Traits, Alloc > lass::stde::strip ( const std::basic_string< Char, Traits, Alloc > &  to_be_stripped  )  [inline]

Return a copy of the string to_be_stripped with leading and trailing whitespace removed.

Definition at line 393 of file extended_string.inl.

References lass::stde::strip(), and lass::stde::impl::whitespace().

Referenced by lass::io::Image::HeaderRadianceHdr::readFrom().


Generated on Mon Nov 10 14:22:06 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo