STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

cstring_range Class Template Reference
[Range Classes]

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

#include <cstring_range.hpp>

Inheritance diagram for cstring_range:

notional_range_tag List of all members.

Public Types

typedef C value_type
 The value type.

typedef cstring_range< C > class_type
 The current parameterisation of the type.

typedef value_type const * const_pointer
 The non-mutable (const) pointer type.

typedef value_type const & const_reference
 The non-mutable (const) reference type.


Public Methods

ss_bool_t 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.

 operator boolean_type () const
 Indicates whether the range is open.

const_reference operator * () const
 Returns the current value in the range.

class_typeoperator++ ()
 Advances the current position in the range.

class_type operator++ (int)
 Advances the current position in the range, returning a copy of the range prior to its being advanced.

Construction
 cstring_range (value_type const *s)
 Constructor.

 ~cstring_range ()
 Destructor.


Detailed Description

template<typename C>
class stlsoft::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');
    


Member Typedef Documentation

typedef cstring_range<C> class_type
 

The current parameterisation of the type.

typedef value_type const* const_pointer
 

The non-mutable (const) pointer type.

typedef value_type const& const_reference
 

The non-mutable (const) reference type.

typedef C value_type
 

The value type.


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

~cstring_range   [inline]
 

Destructor.


Member Function Documentation

class_type& advance   [inline]
 

Advances the current position in the range.

const_reference current   const [inline]
 

Returns the current value in the range.

ss_bool_t is_open   const [inline]
 

Indicates whether the range is open.

const_reference operator *   const [inline]
 

Returns the current value in the range.

operator boolean_type   const [inline]
 

Indicates whether the range is open.

class_type operator++ int    [inline]
 

Advances the current position in the range, returning a copy of the range prior to its being advanced.

class_type& operator++   [inline]
 

Advances the current position in the range.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004