BloombergLP::bdlb::TokenizerIterator

Input iterator over the tokens of a bound Tokenizer input string.

Synopsis

Declared in <bdlb_tokenizer.h>

class TokenizerIterator;

Description

This class provides a C++-standards-conforming input iterator over the tokens in the input string suppled at construction (along with the designation of soft and hard delimiter characters) to a Tokenizer object. Tokens are returned, using a bslstl::StringRef -- by value -- that means the iterated references remain valid until the underlying input string itself is modified or destroyed. Note that all iterators are invalidated whenever the input string in the parent Tokenizer change.

Type Aliases

NameDescription
difference_type Signed type used to represent distances between iterators.
iterator_category Tag identifying this type as an input iterator.
pointer Proxy type returned by operator->.
reference Reference type returned by operator*.
value_type Element type yielded by this iterator (bslstl::StringRef).

Member Functions

NameDescription
TokenizerIterator [constructor]Constructors
operator= Assign to this object the value of the specified rhs iterator, and return a reference providing modifiable access to this object.
operator* Return a reference to the non-modifiable current token.
operator++ Advance this iterator to the next token and return *this.
operator-> Return a proxy holding the non-modifiable current token.

Friends

NameDescription
BloombergLP::bdlb::operator!=Return true if lhs and rhs do not refer to the same token position.
BloombergLP::bdlb::operator==Return true if lhs and rhs refer to the same token position.
BloombergLP::bdlb::TokenizerProvides sequential read-only access to tokens with soft and hard delimiters.

Non-Member Functions

NameDescription
operator++Advance object to the next token and return a copy of its prior value.