Share::String< TAllocator > Class Template Reference
[Leight-weight implementation of some STL containers]

STL string. More...

#include <sharelib.h>

Collaboration diagram for Share::String< TAllocator >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TContainer::iterator iterator
 STL string iterator equivalent.
typedef TContainer::const_iterator const_iterator
 STL string const_iterator equivalent.

Public Member Functions

 String ()
 String (size_type size, const_reference val)
 String (const TItem *sz)
 String (const String &other)
Stringoperator= (const TItem *sz)
Stringoperator= (const String &other)
reference operator[] (size_type index)
const_reference operator[] (size_type index) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
int compare (const String &other) const
bool operator== (const String< TAllocator > &other) const
bool operator!= (const String< TAllocator > &other) const
bool operator<= (const String< TAllocator > &other) const
bool operator>= (const String< TAllocator > &other) const
bool operator< (const String< TAllocator > &other) const
bool operator> (const String< TAllocator > &other) const
void append (const TItem *)
void clear ()
bool empty () const
size_type length () const
const TItem * c_str () const

Detailed Description

template<class TAllocator = std::allocator<char>>
class Share::String< TAllocator >

STL string.

Light-weight implementation of std::string

Parameters:
TAllocator Type of allocator for container. Default is std::allocator. For sharing use Share::Allocator instead.

Definition at line 966 of file sharelib.h.


Member Typedef Documentation

template<class TAllocator = std::allocator<char>>
typedef TContainer::iterator Share::String< TAllocator >::iterator

STL string iterator equivalent.

Definition at line 977 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
typedef TContainer::const_iterator Share::String< TAllocator >::const_iterator

STL string const_iterator equivalent.

Definition at line 978 of file sharelib.h.


Constructor & Destructor Documentation

template<class TAllocator = std::allocator<char>>
Share::String< TAllocator >::String (  )  [inline]

Construct empty string

Definition at line 983 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
Share::String< TAllocator >::String ( size_type  size,
const_reference  val 
) [inline]

Construct string of desired size

Parameters:
size Desired size of string.
val Character to fill string.

Definition at line 993 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
Share::String< TAllocator >::String ( const TItem *  sz  )  [inline]

Construct string from existing zero-ended string.

Parameters:
sz Pointer to zero-ended string.

Definition at line 1003 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
Share::String< TAllocator >::String ( const String< TAllocator > &  other  )  [inline]

Copy constructor

Definition at line 1015 of file sharelib.h.


Member Function Documentation

template<class TAllocator = std::allocator<char>>
String& Share::String< TAllocator >::operator= ( const TItem *  sz  )  [inline]

assignment

Definition at line 1023 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
String& Share::String< TAllocator >::operator= ( const String< TAllocator > &  other  )  [inline]

assignment

Definition at line 1036 of file sharelib.h.

References Share::String< TAllocator >::array_.

template<class TAllocator = std::allocator<char>>
reference Share::String< TAllocator >::operator[] ( size_type  index  )  [inline]

Parameters:
index Index of desired character
Returns:
Return reference to character at desired position.

Definition at line 1045 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
const_reference Share::String< TAllocator >::operator[] ( size_type  index  )  const [inline]

Parameters:
index Index of desired character
Returns:
Return reference to character at desired position.

Definition at line 1052 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
iterator Share::String< TAllocator >::begin (  )  [inline]

Returns:
Return iterator pointing to first character of string.

Definition at line 1059 of file sharelib.h.

References Share::Vector< TItem, TAllocator >::begin().

Referenced by Share::String< TAllocator >::compare().

template<class TAllocator = std::allocator<char>>
iterator Share::String< TAllocator >::end (  )  [inline]

Returns:
Return itertor pointing behind the last character of string.

Definition at line 1066 of file sharelib.h.

Referenced by Share::String< TAllocator >::compare().

template<class TAllocator = std::allocator<char>>
const_iterator Share::String< TAllocator >::begin (  )  const [inline]

Returns:
Return iterator pointing to first character of string.

Definition at line 1073 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
const_iterator Share::String< TAllocator >::end (  )  const [inline]

Returns:
Return itertor pointing behind the last character of string.

Definition at line 1080 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
int Share::String< TAllocator >::compare ( const String< TAllocator > &  other  )  const [inline]

Lexical comparation with other string

Parameters:
other Other string to compare to
Returns:
Return equivalen of strcmp (this, other)

Definition at line 1089 of file sharelib.h.

References Share::String< TAllocator >::begin(), and Share::String< TAllocator >::end().

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator== ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1107 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator!= ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1108 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator<= ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1109 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator>= ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1110 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator< ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1111 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::operator> ( const String< TAllocator > &  other  )  const [inline]

Definition at line 1112 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
void Share::String< TAllocator >::append ( const TItem *   ) 

Note:
Not implemented yet.

Referenced by Share::operator+().

template<class TAllocator = std::allocator<char>>
void Share::String< TAllocator >::clear (  )  [inline]

Replace string with empty string.

Definition at line 1122 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
bool Share::String< TAllocator >::empty (  )  const [inline]

Returns:
Return true if string is empty.

Definition at line 1129 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
size_type Share::String< TAllocator >::length (  )  const [inline]

Returns:
String length

Definition at line 1136 of file sharelib.h.

template<class TAllocator = std::allocator<char>>
const TItem* Share::String< TAllocator >::c_str (  )  const [inline]

Returns:
Return pointer to zero-ended string.

Definition at line 1143 of file sharelib.h.


The documentation for this class was generated from the following file:
Generated on Sun Aug 26 17:43:03 2007 for ShareLibrary by  doxygen 1.5.2