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

str_template Namespace Reference

string utilities More...


Functions

template<class T>
size_t strlen (const T *x)
 template function for string length calculation
template<class T>
T * strcpy (T *dest, const T *x, size_t len=os_minus_one)
 template function for string coping
template<class T>
int strcmp (const T *dest, const T *x, size_t len=os_minus_one)
 template function for string comparision
int strnocasecmp (const char *dest, const char *x, size_t len)
 template function for string comparision without case narrow string
int strnocasecmp (const wchar_t *dest, const wchar_t *x, size_t len)
 template function for string comparision without case wide string
const char * strformat (char *buf, const char *format)
 converts narrow string format to itself
const wchar_tstrformat (wchar_t *buf, const char *format)
 converts narrow string format to wide format string
int strscan (const char *buf, size_t len, const char *format, void *res)
 scans only one parameter narrow char
int strscan (const wchar_t *buf, size_t len, const wchar_t *format, void *res)
 scans only one parameter wide char
int strprint (char *buf, size_t len, const char *format,...)
 prints to memory formatted string narrow string
int strprint (wchar_t *buf, size_t len, const wchar_t *format,...)
 prints to memory formatted string wide string
size_t multibyte_to_unicode_len (const char *x, size_t len=os_minus_one)
 gets the length required for utf-8 to utf-16 conversion
size_t unicode_to_multibyte_len (const wchar_t *x, size_t len=os_minus_one)
 gets the length required for utf-16 to utf-8 conversion
const wchar_tmultibyte_to_unicode (wchar_t *dest, size_t dest_len, const char *x, size_t src_len=os_minus_one)
 converts utf-8 to utf-16 using pre-allocated buffer
const wchar_tmultibyte_to_unicode (wstring_t &dest, const char *x, size_t len=os_minus_one)
 converts utf-8 to utf-16 using wstring_t class
const wchar_tmultibyte_to_unicode (byte_allocator &_allocator, const char *x, size_t len=os_minus_one)
 converts utf-8 to utf-16 using external allocator
const char * unicode_to_multibyte (char *dest, size_t dest_len, const wchar_t *x, size_t src_len=os_minus_one)
 converts utf-16 to utf-8 using pre-allocated buffer
const char * unicode_to_multibyte (string_t &dest, const wchar_t *x, size_t len=os_minus_one)
 converts utf-16 to utf-8 using string_t class
const char * unicode_to_multibyte (byte_allocator &_allocator, const wchar_t *x, size_t len=os_minus_one)
 converts utf-16 to utf-8 using external allocator


Detailed Description

string utilities

Function Documentation

const wchar_t * str_template::multibyte_to_unicode ( byte_allocator _allocator,
const char *  x,
size_t  len = os_minus_one 
) [inline]

converts utf-8 to utf-16 using external allocator

Parameters:
_allocator  external allocator
x  input string
len  input string length

Definition at line 701 of file string.hpp.

References byte_allocator::allocate(), multibyte_to_unicode_len(), os_minus_one, and strlen().

Referenced by multibyte_to_unicode().

const wchar_t * str_template::multibyte_to_unicode ( wstring_t dest,
const char *  x,
size_t  len = os_minus_one 
) [inline]

converts utf-8 to utf-16 using wstring_t class

Parameters:
dest  [out] string object
x  input string
len  input string length

Definition at line 687 of file string.hpp.

References multibyte_to_unicode(), multibyte_to_unicode_len(), os_minus_one, base_string< T >::reserve(), and strlen().

const wchar_t * str_template::multibyte_to_unicode ( wchar_t dest,
size_t  dest_len,
const char *  x,
size_t  src_len = os_minus_one 
) [inline]

converts utf-8 to utf-16 using pre-allocated buffer

Parameters:
dest  [out] buffer
dest_len  buffer length
x  input string
src_len  input string length

Definition at line 599 of file string.hpp.

Referenced by parse_value(), odbc_dbserver::v_connect(), and odbc_dbserver::v_execute().

size_t str_template::multibyte_to_unicode_len ( const char *  x,
size_t  len = os_minus_one 
) [inline]

gets the length required for utf-8 to utf-16 conversion

Parameters:
x  input string
len  string length

Definition at line 530 of file string.hpp.

Referenced by multibyte_to_unicode().

template<class T>
int str_template::strcmp ( const T *  dest,
const T *  x,
size_t  len = os_minus_one 
) [inline]

template<class T>
T * str_template::strcpy ( T *  dest,
const T *  x,
size_t  len = os_minus_one 
) [inline]

const wchar_t * str_template::strformat ( wchar_t buf,
const char *  format 
) [inline]

converts narrow string format to wide format string

Parameters:
buf  [out] buffer
format  input format

Definition at line 397 of file string.hpp.

const char * str_template::strformat ( char *  buf,
const char *  format 
) [inline]

converts narrow string format to itself

Parameters:
buf  [out] buffer
format  input format

Definition at line 390 of file string.hpp.

Referenced by date::get_date(), and date::get_date_only().

template<class T>
size_t str_template::strlen ( const T *  x  )  [inline]

int str_template::strnocasecmp ( const wchar_t dest,
const wchar_t x,
size_t  len 
) [inline]

template function for string comparision without case wide string

Parameters:
dest  first string
x  second string
len  number chars to compare

Definition at line 514 of file string.hpp.

References os_minus_one, and strlen().

Referenced by xmlconfig::getlist(), and xmlconfig::setlist().

int str_template::strnocasecmp ( const char *  dest,
const char *  x,
size_t  len 
) [inline]

int str_template::strprint ( wchar_t buf,
size_t  len,
const wchar_t format,
  ... 
) [inline]

prints to memory formatted string wide string

Parameters:
buf  [out] buffer
len  buffer length
format  format string

Definition at line 445 of file string.hpp.

int str_template::strprint ( char *  buf,
size_t  len,
const char *  format,
  ... 
) [inline]

int str_template::strscan ( const wchar_t buf,
size_t  len,
const wchar_t format,
void *  res 
) [inline]

scans only one parameter wide char

Parameters:
buf  scan buffer
len  buffer length
format  format string
res  pointer to argument memory

Definition at line 417 of file string.hpp.

int str_template::strscan ( const char *  buf,
size_t  len,
const char *  format,
void *  res 
) [inline]

scans only one parameter narrow char

Parameters:
buf  scan buffer
len  buffer length
format  format string
res  pointer to argument memory

Definition at line 406 of file string.hpp.

Referenced by xml_stream_attribute::crack_xml_request(), tokenizer::load_regex(), stream_input_common::open(), msg_communicator::parse_connection(), mysql_dbserver::parse_connection_string(), msg_communicator::parse_listener(), parse_value(), vardatabase::process_xml_request(), and date::scan_buffer().

const char * str_template::unicode_to_multibyte ( byte_allocator _allocator,
const wchar_t x,
size_t  len = os_minus_one 
) [inline]

converts utf-16 to utf-8 using external allocator

Parameters:
_allocator  external allocator
x  input string
len  input string length

Definition at line 851 of file string.hpp.

References byte_allocator::allocate(), os_minus_one, and unicode_to_multibyte_len().

Referenced by unicode_to_multibyte(), and WinMain().

const char * str_template::unicode_to_multibyte ( string_t dest,
const wchar_t x,
size_t  len = os_minus_one 
) [inline]

converts utf-16 to utf-8 using string_t class

Parameters:
dest  [out] string object
x  input string
len  input string length

Definition at line 837 of file string.hpp.

References os_minus_one, base_string< T >::reserve(), unicode_to_multibyte(), and unicode_to_multibyte_len().

const char * str_template::unicode_to_multibyte ( char *  dest,
size_t  dest_len,
const wchar_t x,
size_t  src_len = os_minus_one 
) [inline]

converts utf-16 to utf-8 using pre-allocated buffer

Parameters:
dest  [out] buffer
dest_len  buffer length
x  input string
src_len  input string length

Definition at line 768 of file string.hpp.

References str_leadingByte.

Referenced by var_object_repository::cast_to_common_type(), exception::exception(), persist_value(), mysql_dbserver::v_bind_one_param(), and odbc_dbserver::v_get_one_column_info().

size_t str_template::unicode_to_multibyte_len ( const wchar_t x,
size_t  len = os_minus_one 
) [inline]

gets the length required for utf-16 to utf-8 conversion

Parameters:
x  input string
len  string length

Definition at line 717 of file string.hpp.

Referenced by unicode_to_multibyte().



© Copyright Terimber 2003-.