Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

base_string< T > Class Template Reference

supports base string functionality More...

#include <string.h>

List of all members.

Public Member Functions

 base_string (byte_allocator *allocator_=0)
 default constructor
 ~base_string ()
 destructor
 base_string (const T *x, byte_allocator *allocator_=0)
 constructor from another string
 base_string (const base_string< T > &x)
 copy constructor
 operator const T * () const
 gets string pointer makes it inline, Microsoft can't compile this operator outside header file
base_string< T > & operator= (const base_string< T > &x)
 assign operator
base_string< T > & operator= (const T *x)
 assign operator from string
bool operator== (const base_string< T > &x) const
 operator==
bool operator!= (const base_string< T > &x) const
 operator!=
bool operator< (const base_string< T > &x) const
 operator<
bool operator<= (const base_string< T > &x) const
 operator<=
bool operator> (const base_string< T > &x) const
 operator>
bool operator>= (const base_string< T > &x) const
 operator>=
base_string< T > & operator+= (const base_string< T > &x)
 operator+=
bool operator== (const T *x) const
 operator==
bool operator!= (const T *x) const
 operator!=
bool operator< (const T *x) const
 operator<
bool operator<= (const T *x) const
 operator<=
bool operator> (const T *x) const
 operator>
bool operator>= (const T *x) const
 operator>=
int compare (const T *x, size_t size=os_minus_one) const
 compare function
base_string< T > & operator+= (const T *x)
 operator+= for another string
base_string< T > & append (const T *x, size_t size=os_minus_one)
 appends string
base_string< T > & assign (const T *x, size_t size=os_minus_one)
 assign string
size_t length () const
 returns string length
T * reserve (size_t size)
 reserves memory, be very careful and write no more than allocated chars
byte_allocatorget_allocator ()
 gets external allocator specified in constructor, if any

Private Types

enum  en_base_string_size { S = sizeof(T) }
 calculates char size More...

Private Member Functions

int _compare (const T *x, size_t len=os_minus_one) const
 compare function
void _assign (const T *x, size_t len=os_minus_one)
 allocates string if need & assign
void _add (const T *x, size_t len=os_minus_one)
 appends new string to assigned one previously
void _create ()
 allocates string
void _destroy ()
 destroys string

Private Attributes

byte_allocator_allocator
 external allocator
T * _handle
 string buffer
size_t _length
 string length


Detailed Description

template<class T>
class base_string< T >

supports base string functionality

Definition at line 39 of file string.h.


Member Enumeration Documentation

template<class T>
enum base_string::en_base_string_size [private]

calculates char size

Enumerator:
S  char size

Definition at line 43 of file string.h.


Constructor & Destructor Documentation

template<class T>
base_string< T >::base_string ( byte_allocator allocator_ = 0  )  [inline]

default constructor

Parameters:
allocator_  optional external allocator

Definition at line 43 of file string.hpp.

template<class T>
base_string< T >::~base_string (  )  [inline]

destructor

Definition at line 52 of file string.hpp.

References base_string< T >::_destroy().

template<class T>
base_string< T >::base_string ( const T *  x,
byte_allocator allocator_ = 0 
) [inline]

constructor from another string

Parameters:
x  input string
allocator_  optional external allocator

Definition at line 60 of file string.hpp.

template<class T>
base_string< T >::base_string ( const base_string< T > &  x  )  [inline]

copy constructor

Definition at line 69 of file string.hpp.


Member Function Documentation

template<class T>
base_string< T >::operator const T * (  )  const [inline]

gets string pointer makes it inline, Microsoft can't compile this operator outside header file

Definition at line 63 of file string.h.

References base_string< T >::_handle.

template<class T>
base_string< T > & base_string< T >::operator= ( const base_string< T > &  x  )  [inline]

assign operator

Definition at line 91 of file string.hpp.

References base_string< T >::_assign(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
base_string< T > & base_string< T >::operator= ( const T *  x  )  [inline]

assign operator from string

Parameters:
x  input string

Definition at line 80 of file string.hpp.

References base_string< T >::_assign().

template<class T>
bool base_string< T >::operator== ( const base_string< T > &  x  )  const [inline]

operator==

Definition at line 102 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator!= ( const base_string< T > &  x  )  const [inline]

operator!=

Definition at line 110 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator< ( const base_string< T > &  x  )  const [inline]

operator<

Definition at line 118 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator<= ( const base_string< T > &  x  )  const [inline]

operator<=

Definition at line 126 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator> ( const base_string< T > &  x  )  const [inline]

operator>

Definition at line 134 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator>= ( const base_string< T > &  x  )  const [inline]

operator>=

Definition at line 142 of file string.hpp.

References base_string< T >::_compare(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
base_string< T > & base_string< T >::operator+= ( const base_string< T > &  x  )  [inline]

operator+=

Definition at line 219 of file string.hpp.

References base_string< T >::_add(), base_string< T >::_handle, and base_string< T >::_length.

template<class T>
bool base_string< T >::operator== ( const T *  x  )  const [inline]

operator==

compare operator for input pointers

Parameters:
x  input string

Definition at line 152 of file string.hpp.

References base_string< T >::_compare().

template<class T>
bool base_string< T >::operator!= ( const T *  x  )  const [inline]

operator!=

Parameters:
x  input string

Definition at line 160 of file string.hpp.

References base_string< T >::_compare().

template<class T>
bool base_string< T >::operator< ( const T *  x  )  const [inline]

operator<

Parameters:
x  input string

Definition at line 168 of file string.hpp.

References base_string< T >::_compare().

template<class T>
bool base_string< T >::operator<= ( const T *  x  )  const [inline]

operator<=

Parameters:
x  input string

Definition at line 176 of file string.hpp.

References base_string< T >::_compare().

template<class T>
bool base_string< T >::operator> ( const T *  x  )  const [inline]

operator>

Parameters:
x  input string

Definition at line 184 of file string.hpp.

References base_string< T >::_compare().

template<class T>
bool base_string< T >::operator>= ( const T *  x  )  const [inline]

operator>=

Parameters:
x  input string

Definition at line 192 of file string.hpp.

References base_string< T >::_compare().

template<class T>
int base_string< T >::compare ( const T *  x,
size_t  size = os_minus_one 
) const [inline]

compare function

Parameters:
x  input string
size  string length

Definition at line 200 of file string.hpp.

References base_string< T >::_compare().

template<class T>
base_string< T > & base_string< T >::operator+= ( const T *  x  )  [inline]

operator+= for another string

Parameters:
x  input string

Definition at line 210 of file string.hpp.

References base_string< T >::_add().

template<class T>
base_string< T > & base_string< T >::append ( const T *  x,
size_t  size = os_minus_one 
) [inline]

appends string

Parameters:
x  input string
size  string length

Definition at line 230 of file string.hpp.

References base_string< T >::_add().

Referenced by byte_source::convert_chars(), xml_stream_attribute::crack_xml_request(), and byte_source::throw_exception().

template<class T>
base_string< T > & base_string< T >::assign ( const T *  x,
size_t  size = os_minus_one 
) [inline]

assign string

Parameters:
x  input string
size  string length

Definition at line 241 of file string.hpp.

References base_string< T >::_assign().

Referenced by xml_stream_attribute::crack_xml_request(), mysql_dbserver::parse_connection_string(), xml_designer_impl::select_xpath(), and xmlconfig::xmlconfig().

template<class T>
T * base_string< T >::reserve ( size_t  size  )  [inline]

reserves memory, be very careful and write no more than allocated chars

Parameters:
size  string length

Definition at line 262 of file string.hpp.

References base_string< T >::_create(), base_string< T >::_destroy(), base_string< T >::_handle, and base_string< T >::_length.

Referenced by str_template::multibyte_to_unicode(), and str_template::unicode_to_multibyte().

template<class T>
byte_allocator * base_string< T >::get_allocator (  )  [inline]

gets external allocator specified in constructor, if any

Definition at line 279 of file string.hpp.

References base_string< T >::_allocator.

template<class T>
int base_string< T >::_compare ( const T *  x,
size_t  len = os_minus_one 
) const [inline, private]

template<class T>
void base_string< T >::_assign ( const T *  x,
size_t  len = os_minus_one 
) [inline, private]

allocates string if need & assign

Parameters:
x  input string
len  string length

Definition at line 305 of file string.hpp.

References base_string< T >::_add(), base_string< T >::_allocator, base_string< T >::_destroy(), base_string< T >::_handle, base_string< T >::_length, and byte_allocator::deallocate().

Referenced by base_string< T >::assign(), and base_string< T >::operator=().

template<class T>
void base_string< T >::_add ( const T *  x,
size_t  len = os_minus_one 
) [inline, private]

template<class T>
void base_string< T >::_create (  )  [inline, private]

template<class T>
void base_string< T >::_destroy (  )  [inline, private]


Member Data Documentation


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


© Copyright Terimber 2003-.