pstade

PrevUpHomeNext

String Adaptors

broken_into
lower_chars
upper_chars
narrow_chars
wide_chars
string_found
string_split
matches
tokenized
utf8_decoded
utf8_encoded
utf16_decoded
utf16_encoded
xpressive_matches
xpressive_tokenized

String Adaptor is Range Adaptor for strings.

Description
  • broken_into is a range adaptor version of boost::tokenizer.
Header
  • <pstade/oven/broken_into.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_broken_into<V>

A Major Function Object type

X_make_broken_into<V>()(_rng, k)

[T(k, _begin(_rng), _end(_rng)), T(k, _end(_rng), boost:end(_rng)))

_rng|oven::broken_into<V>(k)

X_make_broken_into<V>()(_rng, k)

Preconditions
  • k is a TokenizerFunction.
  • T is boost::token_iterator<_typeof(k), _iter_of<_typeof(_rng)>::type, V> such that T(k, _begin(_rng), _end(_rng)) is a valid expression.
Example
int const offsets[] = { 2,2,4 };
std::string src("12252001");
std::vector<std::string> ans; {
    ans.push_back("12");
    ans.push_back("25");
    ans.push_back("2001");
}

BOOST_CHECK( equals(
    ans,
    src|oven::broken_into<std::string>(boost::offset_separator(offsets, offsets+3))
) );
See also
Description

lower_chars performs case-conversion on all characters in the base range.

Header
  • <pstade/oven/lower_chars.hpp>
Model of
Notation
  • loc is a std::locale object.
  • to_l is an imaginary function object to call std::tolower using loc.
Valid expressions

Valid expression

Semantics

_rng|lower_chars(loc)

_rng|transformed(to_l)

_rng|lower_chars

_rng|lower_chars(std::locale())

Preconditions
  • std::tolower(*boost::begin(_rng), loc) is well-formed.
Example
BOOST_CHECK( equals(
    std::string("AbCdEFG")|lower_chars,
    std::string("abcdefg")
) );
See also
Description

upper_chars performs case-conversion on all characters in the base range.

Header
  • <pstade/oven/upper_chars.hpp>
Model of
Notation
  • loc is a std::locale object.
  • to_u is an imaginary function object to call std::toupper using loc.
Valid expressions

Valid expression

Semantics

_rng|upper_chars(loc)

_rng|transformed(to_u)

_rng|upper_chars

_rng|upper_chars(std::locale())

Preconditions
  • std::toupper(*boost::begin(_rng), loc) is well-formed.
Example
BOOST_CHECK( equals(
    std::string("AbCdEFG")|upper_chars,
    std::string("ABCDEFG")
) );
See also
Description
Header
  • <pstade/oven/narrow_chars.hpp>
Model of
Notation
  • loc is a std::locale object.
  • to_n is an imaginary function object to call narrow using loc.
Valid expressions

Valid expression

Semantics

_rng|narrow_chars(loc)

_rng|transformed(to_n)

_rng|narrow_chars

_rng|narrow_chars(std::locale())

Preconditions
  • std::use_facet< std::ctype<_value_of<_typeof(_rng)>::type> >(loc).narrow(*boost::begin(_rng)) is well-formed.
Example
See also
Description
Header
  • <pstade/oven/wide_chars.hpp>
Model of
Notation
  • loc is a std::locale object.
  • to_w is an imaginary function object to call widen using loc.
Valid expressions

Valid expression

Semantics

X_make_wide_chars<CharT = wchar_t>

A Major Function Object

X_make_wide_chars<CharT>()(_rng, loc = std::locale())

_rng|transformed(to_w)

rng|wide_chars

X_make_wide_chars<>(_rng)

Preconditions
  • std::use_facet< std::ctype<CharT> >(loc).widen(*boost::begin(_rng)) is well-formed.
Example
See also
Description

string_found returns a boost::find_iterator range.

Header
  • <pstade/oven/string_found.hpp>
Model of
Valid expressions

Valid expression

Semantics

_rng|string_found(f)

[T(_rng, f), T())

Preconditions
  • f is a Finder.
  • T is boost::find_iterator<_iter_of<_typeof(_rng)>::type> such that T(_rng, f) is a valid expression.
Example
See also
Description

string_split returns a boost::split_iterator range.

Header
  • <pstade/oven/string_split.hpp>
Model of
Valid expressions

Valid expression

Semantics

_rng|string_split(f)

[T(_rng, f), T())

Preconditions
  • f is a Finder.
  • T is boost::split_iterator<_iter_of<_typeof(_rng)>::type> such that T(_rng, f) is a valid expression.
Example
See also
Description

matches returns a boost::regex_iterator range.

Header
  • <pstade/oven/matches.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_matches<X1,...,XN>

A Major Function Object type

X_make_matches<X1,...,XN>()(_bidrng, y1,...,yM)

[T(_begin(_bidrng), _end(_bidrng), y1,...,yM), T())

_bidrng|matches

X_make_matches<>()(_bidrng)

Preconditions
  • T is boost::regex_iterator<_iter_of<_typeof(_bidrng)>::type, X1,...,XN> such that T(_begin(_bidrng), _end(_bidrng), y0,...,yM) is a valid expression.
Invariants
Example
See also
Description

tokenized returns a boost::regex_token_iterator range.

Header
  • <pstade/oven/tokenized.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_tokenized<Y1,...,YN>

A Major Function Object type

X_make_tokenized<Y1,...,YN>()(_bidrng, x1,...,xM)

[T(_begin(_bidrng), _end(_bidrng), x1,...,xM), T())

_bidrng|tokenized

X_make_tokenized<>()(_bidrng)

Preconditions
  • T is boost::regex_token_iterator<_iter_of<_typeof(_bidrng)>::type, Y1,...,YN> such that T(_begin(_bidrng), _end(_bidrng), x1,...,xM) is a valid expression.
Invariants
Example
See also
Description

Pending...

Header
  • <pstade/oven/utf8_decoded.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_utf8_decoded<U1,...,UN>

A Major Function Object type

X_make_utf8_decoded<U1,...,UN>()(_fwdrng)

An up-to-Bidirectional non-Lvalue Constant [T(_begin(_fwdrng)), T(_end(_fwdrng)))

_fwdrng|utf8_decoded

X_make_utf8_decoded<>()(_fwdrng)

Preconditions
  • _fwdrng is Readable.
  • T is boost::u8_to_u32_iterator<_iter_of<_typeof(_fwdrng)>::type, U1,...,UN> such that T(_begin(_fwdrng)) is a valid expression.
Example
file_range<boost::uint8_t> frng("utf8.txt");
std::vector<boost::uint8_t> result;
copy(frng|utf8_decoded, utf8_encoder|=back_inserter(result));
BOOST_CHECK( equals(frng, result) );
See also
Description

Pending...

Header
  • <pstade/oven/utf8_encoded.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_utf8_encoded<U1,...,UN>

A Major Function Object type

X_make_utf8_encoded<U1,...,UN>()(_rng)

An up-to-Bidirectional non-Lvalue Constant [T(_begin(_rng)), T(_end(_rng)))

_rng|utf8_encoded

X_make_utf8_encoded<>()(_rng)

Preconditions
  • _rng is Readable.
  • T is boost::u32_to_u8_iterator<_iter_of<_typeof(_rng)>::type, U1,...,UN> such that T(_begin(_rng)) is a valid expression.
Example
See also
Description

Pending...

Header
  • <pstade/oven/utf16_decoded.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_utf16_decoded<U1,...,UN>

A Major Function Object type

X_make_utf16_decoded<U1,...,UN>()(_fwdrng)

An up-to-Bidirectional non-Lvalue Constant [T(_begin(_fwdrng)), T(_end(_fwdrng)))

_fwdrng|utf16_decoded

X_make_utf16_decoded<>()(_fwdrng)

Preconditions
  • _fwdrng is Readable.
  • T is boost::u16_to_u32_iterator<_iter_of<_typeof(_fwdrng)>::type, U1,...,UN> such that T(_begin(_fwdrng)) is a valid expression.
Example
See also
Description

Pending...

Header
  • <pstade/oven/utf16_encoded.hpp>
Model of
Valid expressions

Valid expression

Semantics

X_make_utf16_encoded<U1,...,UN>

A Major Function Object type

X_make_utf16_encoded<U1,...,UN>()(_rng)

An up-to-Bidirectional non-Lvalue Constant [T(_begin(_rng)), T(_end(_rng)))

_rng|utf16_encoded

X_make_utf16_encoded<>()(_rng)

Preconditions
  • _rng is Readable.
  • T is boost::u32_to_u16_iterator<_iter_of<_typeof(_rng)>::type, U1,...,UN> such that T(_begin(_rng)) is a valid expression.
Example
See also
Description

xpressive_matches returns a boost::xpressive::regex_iterator range.

Header
  • <pstade/oven/xpressive_matches.hpp>
Model of
Valid expressions

Valid expression

Semantics

_bidrng|xpressive_matches(x1,...,xN)

[T(_begin(_bidrng), _end(_bidrng), x1,...,xN), T())

Preconditions
  • T is boost::xpressive::regex_iterator<boost::range_const_iterator<_typeof(_bidrng)>::type> such that T(_begin(_bidrng), _end(_bidrng), x1,...,xN) is a valid expression.
Invariants
  • The iterator type of xpressive_matches range is not Parallel Safe.
Example
See also
Description

xpressive_tokenized returns a boost::xpressive::regex_token_iterator range.

Header
  • <pstade/oven/xpressive_tokenized.hpp>
Model of
Valid expressions

Valid expression

Semantics

_bidrng|xpressive_tokenized(x1,...,xN)

[T(_begin(_bidrng), _end(_bidrng), x1,...,xN), T())

Preconditions
  • T is boost::xpressive::regex_token_iterator<boost::range_const_iterator<_typeof(_bidrng)>::type> such that T(_begin(_bidrng), _end(_bidrng), x1,...,xN) is a valid expression.
Invariants
  • The iterator type of xpressive_tokenized range is not Parallel Safe.
Example
See also
Copyright 2005 -2007 Shunsuke Sogame

PrevUpHomeNext