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  

basic_static_string Class Template Reference
[String Library (STLSoft)]

Simple string class using fixed-size static-based storage. More...

#include <stlsoft_static_string.h>

List of all members.

Attributes

size_type length () const
 The number of elements in the string.

size_type capacity () const
 The storage currently allocated by the string.

ss_bool_t empty () const
 Indicates whether the string is empty.

size_type size ()
 The number of elements in the string.

size_type max_size ()
 The maximum number of elements that can be stored in the string.


Public Types

typedef C value_type
 The value type.

typedef T traits_type
 The traits type.

typedef basic_static_string<
C, cch, T > 
class_type
 The current parameterisation of the type.

typedef value_type char_type
 The character type.

typedef value_typepointer
 The pointer type.

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

typedef value_typereference
 The reference type.

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

typedef ss_size_t size_type
 The size type.

typedef ss_ptrdiff_t difference_type
 The difference type.

typedef pointer_iterator<
value_type, pointer, reference
>::iterator_type 
iterator
 The iterator type.

typedef pointer_iterator<
value_type const, const_pointer,
const_reference >::iterator_type 
const_iterator
 The non-mutating (const) iterator type.

typedef reverse_iterator_base<
iterator, value_type, reference,
pointer, difference_type
reverse_iterator
 The reverse iterator type.

typedef const_reverse_iterator_base<
const_iterator, value_type
const, const_reference, const_pointer,
difference_type
const_reverse_iterator
 The non-mutating (const) reverse iterator type.


Public Methods

Construction
 basic_static_string ()
 Default constructor.

 basic_static_string (class_type const &rhs)
 Copy constructor.

 basic_static_string (class_type const &s, size_type pos)
 Construct from the given string at the specified position.

 basic_static_string (class_type const &s, size_type pos, size_type n)
 Construct with n characters from the given string at the specified position.

 basic_static_string (char_type const *s)
 Construct from the given character string.

 basic_static_string (char_type const *s, size_type n)
 Construct with n characters from the given character string.

 basic_static_string (size_type n, char_type ch)
 Construct with n characters each set to ch.

 basic_static_string (char_type const *f, char_type const *t)
 Construct from the range [first:last).

 ~basic_static_string ()
 Destructor.

Assignment
class_typeassign (const char_type *s)
 Assigns from the given character string.

class_typeassign (const char_type *s, size_type n)
 Assigns with n characters from the given character string.

class_typeassign (class_type const &str, size_type pos, size_type n)
 Assigns with n characters from the given character string at the specified position.

class_typeassign (class_type const &str)
 Assigns from the given string.

class_typeassign (size_type n, char_type c)
 Assigns n characters with the value ch.

class_typeassign (const_iterator first, const_iterator last)
 Assigns from the range [first:last).

class_type const & operator= (class_type const &rhs)
 Copy assignment operator.

class_type const & operator= (char_type const *s)
 Assignment operator.

class_type const & operator= (char_type c)
 Assignment operator.

Appending
class_typeappend (char_type const *s)
 Appends the given character string.

class_typeappend (char_type const *s, size_type cch)
 Appends cch characters from the given character string.

class_typeappend (class_type const &str, size_type pos, size_type cch)
 Assigns cch characters from the given character string at the specified position.

class_typeappend (class_type const &str)
 Appends the given string.

class_typeappend (size_type cch, char_type ch)
 Appends cch characters with the value ch.

class_typeappend (const_iterator first, const_iterator last)
 Appends the range [first:last).

class_typeoperator+= (char_type ch)
 Concatenation operator.

class_typeoperator+= (char_type const *s)
 Concatenation operator.

class_typeoperator+= (class_type const &rhs)
 Concatenation operator.

void push_back (char_type ch)
 Appends a single character.

Operations
void reserve (size_type n)
 Reserves at least n characters.

void swap (class_type &other)
 Swaps the contents between this and other.

void resize (size_type n, value_type ch=value_type())
 Resizes the string.

void clear ()
 Empties the string.

Comparison
ss_sint_t compare (size_type pos, size_type n, value_type const *s, size_type cchRhs) const
 Compares this with the given string.

ss_sint_t compare (size_type pos, size_type n, value_type const *s) const
 Compares this with the given string.

ss_sint_t compare (value_type const *s) const
 Compares this with the given string.

ss_sint_t compare (size_type pos, size_type n, class_type const &rhs, size_type posRhs, size_type cchRhs) const
 Compares this with the given string.

ss_sint_t compare (size_type pos, size_type n, class_type const &rhs) const
 Compares this with the given string.

ss_sint_t compare (class_type const &rhs) const
 Compares this with the given string.

Accessors
reference operator[] (size_type index)
 Returns mutable reference at the given index.

const_reference operator[] (size_type index) const
 Returns non-mutable (const) reference at the given index.

value_type const * c_str () const
 Returns null-terminated non-mutable (const) pointer to string data.

value_type const * data () const
 Returns non-mutable (const) pointer to string data.

size_type copy (value_type *dest, size_type cch_, size_type pos=0) const
 Copies elements into the given destination.

Iteration
const_iterator begin () const
 Begins the iteration.

const_iterator end () const
 Ends the iteration.

iterator begin ()
 Begins the iteration.

iterator end ()
 Ends the iteration.

const_reverse_iterator rbegin () const
 Begins the reverse iteration.

const_reverse_iterator rend () const
 Ends the reverse iteration.

reverse_iterator rbegin ()
 Begins the reverse iteration.

reverse_iterator rend ()
 Ends the reverse iteration.


Detailed Description

template<typename C, ss_size_t CCH, typename T = char_traits<C>>
class stlsoft::basic_static_string< C, CCH, T >

Simple string class using fixed-size static-based storage.

Parameters:
C  The character type
CCH  The number of characters in the fixed-side buffer, not including the null-terminator
T  The traits type. On translators that support default template arguments this is defaulted to char_traits<C>


Member Typedef Documentation

typedef value_type char_type
 

The character type.

typedef basic_static_string<C, cch, T> class_type
 

The current parameterisation of the type.

typedef pointer_iterator< value_type const , const_pointer , const_reference >::iterator_type const_iterator
 

The non-mutating (const) iterator 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 const_reverse_iterator_base< const_iterator , value_type const , const_reference , const_pointer , difference_type > const_reverse_iterator
 

The non-mutating (const) reverse iterator type.

typedef ss_ptrdiff_t difference_type
 

The difference type.

typedef pointer_iterator< value_type , pointer , reference >::iterator_type iterator
 

The iterator type.

typedef value_type* pointer
 

The pointer type.

typedef value_type& reference
 

The reference type.

typedef reverse_iterator_base< iterator , value_type , reference , pointer , difference_type > reverse_iterator
 

The reverse iterator type.

typedef ss_size_t size_type
 

The size type.

typedef T traits_type
 

The traits type.

typedef C value_type
 

The value type.


Constructor & Destructor Documentation

basic_static_string  
 

Default constructor.

basic_static_string class_type const &    rhs
 

Copy constructor.

basic_static_string class_type const &    s,
size_type    pos
 

Construct from the given string at the specified position.

basic_static_string class_type const &    s,
size_type    pos,
size_type    n
 

Construct with n characters from the given string at the specified position.

basic_static_string char_type const *    s
 

Construct from the given character string.

basic_static_string char_type const *    s,
size_type    n
 

Construct with n characters from the given character string.

basic_static_string size_type    n,
char_type    ch
 

Construct with n characters each set to ch.

basic_static_string char_type const *    f,
char_type const *    t
 

Construct from the range [first:last).

~basic_static_string  
 

Destructor.


Member Function Documentation

class_type& append const_iterator    first,
const_iterator    last
 

Appends the range [first:last).

class_type& append size_type    cch,
char_type    ch
 

Appends cch characters with the value ch.

class_type& append class_type const &    str
 

Appends the given string.

class_type& append class_type const &    str,
size_type    pos,
size_type    cch
 

Assigns cch characters from the given character string at the specified position.

class_type& append char_type const *    s,
size_type    cch
 

Appends cch characters from the given character string.

class_type& append char_type const *    s
 

Appends the given character string.

class_type& assign const_iterator    first,
const_iterator    last
 

Assigns from the range [first:last).

class_type& assign size_type    n,
char_type    c
 

Assigns n characters with the value ch.

class_type& assign class_type const &    str
 

Assigns from the given string.

class_type& assign class_type const &    str,
size_type    pos,
size_type    n
 

Assigns with n characters from the given character string at the specified position.

class_type& assign const char_type   s,
size_type    n
 

Assigns with n characters from the given character string.

class_type& assign const char_type   s
 

Assigns from the given character string.

iterator begin  
 

Begins the iteration.

Returns:
An iterator representing the start of the sequence

const_iterator begin  
 

Begins the iteration.

Returns:
A non-mutable (const) iterator representing the start of the sequence

value_type const* c_str  
 

Returns null-terminated non-mutable (const) pointer to string data.

size_type capacity  
 

The storage currently allocated by the string.

void clear  
 

Empties the string.

ss_sint_t compare class_type const &    rhs const
 

Compares this with the given string.

ss_sint_t compare size_type    pos,
size_type    n,
class_type const &    rhs
const
 

Compares this with the given string.

ss_sint_t compare size_type    pos,
size_type    n,
class_type const &    rhs,
size_type    posRhs,
size_type    cchRhs
const
 

Compares this with the given string.

ss_sint_t compare value_type const *    s const
 

Compares this with the given string.

ss_sint_t compare size_type    pos,
size_type    n,
value_type const *    s
const
 

Compares this with the given string.

ss_sint_t compare size_type    pos,
size_type    n,
value_type const *    s,
size_type    cchRhs
const
 

Compares this with the given string.

size_type copy value_type   dest,
size_type    cch_,
size_type    pos = 0
const
 

Copies elements into the given destination.

value_type const* data  
 

Returns non-mutable (const) pointer to string data.

ss_bool_t empty  
 

Indicates whether the string is empty.

iterator end  
 

Ends the iteration.

Returns:
An iterator representing the end of the sequence

const_iterator end  
 

Ends the iteration.

Returns:
A non-mutable (const) iterator representing the end of the sequence

size_type length  
 

The number of elements in the string.

size_type max_size   [static]
 

The maximum number of elements that can be stored in the string.

class_type& operator+= class_type const &    rhs
 

Concatenation operator.

class_type& operator+= char_type const *    s
 

Concatenation operator.

class_type& operator+= char_type    ch
 

Concatenation operator.

class_type const& operator= char_type    c
 

Assignment operator.

class_type const& operator= char_type const *    s
 

Assignment operator.

class_type const& operator= class_type const &    rhs
 

Copy assignment operator.

const_reference operator[] size_type    index const
 

Returns non-mutable (const) reference at the given index.

reference operator[] size_type    index
 

Returns mutable reference at the given index.

void push_back char_type    ch
 

Appends a single character.

reverse_iterator rbegin  
 

Begins the reverse iteration.

Returns:
An iterator representing the start of the reverse sequence

const_reverse_iterator rbegin  
 

Begins the reverse iteration.

Returns:
A non-mutable (const) iterator representing the start of the reverse sequence

reverse_iterator rend  
 

Ends the reverse iteration.

Returns:
An iterator representing the end of the reverse sequence

const_reverse_iterator rend  
 

Ends the reverse iteration.

Returns:
A non-mutable (const) iterator representing the end of the reverse sequence

void reserve size_type    n
 

Reserves at least n characters.

void resize size_type    n,
value_type    ch = value_type()
 

Resizes the string.

Parameters:
n  The new size of the string
ch  The value with which to initialise additional items if the string is expanded

size_type size   [static]
 

The number of elements in the string.

void swap class_type   other
 

Swaps the contents between this and other.


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

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