#include <rangelib/cstring_range.hpp>
It is categoried as a Notional Range
It could be used as follows
// Create a range based on a C-string stlsoft::cstring_range r("This is a literal string"); // Count the number of i's in the string size_t num_Is = stlsoft::r_count(r, 'i');
Public Types | |
Types | |
typedef C | value_type |
The value type. | |
typedef notional_range_tag | range_tag_type |
The range tag type. | |
typedef cstring_range< C > | class_type |
The current parameterisation of the type. | |
typedef value_type const & | const_reference |
The non-mutable (const) reference type. | |
Public Member Functions | |
Construction | |
cstring_range (value_type const *s) | |
Constructor. | |
~cstring_range () throw () | |
Destructor. | |
Range methods | |
bool | is_open () const |
Indicates whether the range is open. | |
const_reference | current () const |
Returns the current value in the range. | |
class_type & | advance () |
Advances the current position in the range. |
typedef C value_type |
The value type.
typedef notional_range_tag range_tag_type |
The range tag type.
typedef cstring_range<C> class_type |
typedef value_type const& const_reference |
cstring_range | ( | value_type const * | s | ) | [inline] |
Constructor.
s | The C-string for which this instance will act as a range |
References STLSOFT_MESSAGE_ASSERT.
~cstring_range | ( | ) | throw () [inline] |
bool is_open | ( | ) | const [inline] |
const_reference current | ( | ) | const [inline] |
class_type& advance | ( | ) | [inline] |