cstring_range Class Template Reference

#include <rangelib/cstring_range.hpp>

Inheritance diagram for cstring_range:

non_mutating_operator_adaptor notional_range_tag

List of all members.


Detailed Description

template<typename C>
class rangelib::cstring_range< C >

This class represents a C-style string as a range.

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_typeadvance ()
 Advances the current position in the range.

Member Typedef Documentation

typedef C value_type

The value type.

The range tag type.

The current parameterisation of the type.

Reimplemented from non_mutating_operator_adaptor.

typedef value_type const& const_reference

The non-mutable (const) reference type.

Reimplemented from non_mutating_operator_adaptor.


Constructor & Destructor Documentation

cstring_range ( value_type const *  s  )  [inline]

Constructor.

Parameters:
s The C-string for which this instance will act as a range

References STLSOFT_MESSAGE_ASSERT.

~cstring_range (  )  throw () [inline]

Destructor.

References STLSOFT_STATIC_ASSERT.


Member Function Documentation

bool is_open (  )  const [inline]

Indicates whether the range is open.

References STLSOFT_ASSERT.

const_reference current (  )  const [inline]

Returns the current value in the range.

References STLSOFT_MESSAGE_ASSERT.

class_type& advance (  )  [inline]

Advances the current position in the range.

References STLSOFT_MESSAGE_ASSERT.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:33 2010 for STLSoft by  doxygen 1.5.6