misc::ststring< LEN > Class Template Reference

Static string encapsulation. More...

#include <string.h>

List of all members.

Public Member Functions

 ststring ()
 Default onstructor.
 ststring (char const *str)
 Constructor initializing the encapsulated string.
 ststring (ststring const &sts)
 Copy constructor.
ststringoperator= (ststring const &right)
 Assignment operator (for cstring r-values).
ststringoperator= (char const *right)
 Assigns a new string.
bool operator== (char const *right) const
 Checks two strings for equality, byte-per-byte.
bool operator!= (char const *right) const
 Checks two strings for difference, byte-per-byte.
 operator char * ()
 Conversion operator (to char *).
 operator char const * () const
 Conversion operator (to const char *).
char * str ()
 Returns The encapsulated string, or NULL if it is empty.
char const * str () const
 Returns the encapsulated string, or NULL if it is empty (const version).

Static Public Attributes

static size_t const max_len = LEN
 Maximum length of the string.


Detailed Description

template<size_t LEN>
class misc::ststring< LEN >

This template class encapsulates a statically-allocated C string.

Constructor & Destructor Documentation

template<size_t LEN>
misc::ststring< LEN >::ststring ( char const *  str  )  [inline, explicit]

This constructor initializes the encapsulated string to a copy of the given string.

Parameters:
[in] str The string to copy. If it is longer than what the encapsulated string can contain, it is truncated.


Member Function Documentation

template<size_t LEN>
ststring& misc::ststring< LEN >::operator= ( char const *  right  )  [inline]

Assigns a new string to the encapsulated string.

Parameters:
[in] right The string to copy.
Returns:
The ststring object.

template<size_t LEN>
bool misc::ststring< LEN >::operator== ( char const *  right  )  const [inline]

Does a byte-per-byte comparison of the encapsulated string and the given one. The comparison is done only on the characters that would actually fit in the encapsulated string.

Parameters:
[in] right The string to compare to the encapsulated string.
Returns:
true if the two strings are the same or are both NULL, false if they're different or if only one of the strings is NULL.

template<size_t LEN>
bool misc::ststring< LEN >::operator!= ( char const *  right  )  const [inline]

Does a byte-per-byte comparison of the encapsulated string and the given one. The comparison is done only on the characters that would actually fit in the encapsulated string.

Parameters:
[in] right The string to compare to the encapsulated string.
Returns:
true if the two strings are different or if at least one of the strings is NULL, false otherwise.


The documentation for this class was generated from the following file:
Generated on Fri Apr 18 22:03:28 2008 for Epona API by  doxygen 1.5.3