BLOCXX_NAMESPACE::IConv Namespace Reference

The IConv namespace contains some utility functions based on the IConv_t class. More...


Functions

static void mayThrowStringConversionException ()
String fromByteString (const String &enc, const char *str, size_t len)
 Converts a C string from the specified encoding into a String object using UTF-8 encoding.
String fromByteString (const String &enc, const std::string &str)
 Converts a std::string from the specified encoding into a String object using UTF-8 encoding.
String fromWideString (const String &enc, const std::wstring &str)
 Converts a std::wstring from the specified encoding into a String object using UTF-8 encoding.
std::string toByteString (const String &enc, const String &utf8)
 Converts a UTF-8 String to the specified encoding casted as a (char based) std::string.
std::wstring toWideString (const String &enc, const String &utf8)
 Convert a UTF-8 String to the specified encoding casted as a (wchar_t based) std::wstring.


Detailed Description

The IConv namespace contains some utility functions based on the IConv_t class.

Function Documentation

String BLOCXX_NAMESPACE::IConv::fromByteString const String &  enc,
const std::string &  str
 

Converts a std::string from the specified encoding into a String object using UTF-8 encoding.

Parameters:
enc source encoding name
str source std::string
Returns:
new, UTF-8 encoded String object
Exceptions:
StringConversionException if the conversion is not supported or incomplete or invalid character or multibyte sequence was found.

Definition at line 185 of file IConv.cpp.

References BLOCXX_NAMESPACE::String::c_str(), and fromByteString().

String BLOCXX_NAMESPACE::IConv::fromByteString const String &  enc,
const char *  str,
size_t  len
 

Converts a C string from the specified encoding into a String object using UTF-8 encoding.

Parameters:
enc source encoding name
str source string pointer
len source string length
Returns:
new, UTF-8 encoded String object
Exceptions:
StringConversionException if the conversion is not supported or incomplete or invalid character or multibyte sequence was found.

Definition at line 150 of file IConv.cpp.

References BLOCXX_NAMESPACE::IConv_t::convert(), and mayThrowStringConversionException().

Referenced by fromByteString().

String BLOCXX_NAMESPACE::IConv::fromWideString const String &  enc,
const std::wstring &  str
 

Converts a std::wstring from the specified encoding into a String object using UTF-8 encoding.

Parameters:
enc source encoding name
str source std::wstring
Returns:
new, UTF-8 encoded String object
Exceptions:
StringConversionException if the conversion is not supported or incomplete or invalid character or multibyte sequence was found.

Definition at line 193 of file IConv.cpp.

References BLOCXX_NAMESPACE::IConv_t::convert(), and mayThrowStringConversionException().

static void BLOCXX_NAMESPACE::IConv::mayThrowStringConversionException  )  [inline, static]
 

Definition at line 128 of file IConv.cpp.

References BLOCXX_THROW.

Referenced by fromByteString(), fromWideString(), toByteString(), and toWideString().

std::string BLOCXX_NAMESPACE::IConv::toByteString const String &  enc,
const String &  utf8
 

Converts a UTF-8 String to the specified encoding casted as a (char based) std::string.

Parameters:
enc encoding name
utf8 source UTF-8 encoded String
Returns:
new, encoded std::string object
Exceptions:
StringConversionException if the conversion is not supported or incomplete or invalid character or multibyte sequence was found.

Definition at line 227 of file IConv.cpp.

References BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::IConv_t::convert(), BLOCXX_NAMESPACE::String::empty(), BLOCXX_NAMESPACE::String::length(), and mayThrowStringConversionException().

std::wstring BLOCXX_NAMESPACE::IConv::toWideString const String &  enc,
const String &  utf8
 

Convert a UTF-8 String to the specified encoding casted as a (wchar_t based) std::wstring.

Parameters:
enc encoding name
utf8 source UTF-8 encoded String
Returns:
new, encoded std::wstring object
Exceptions:
StringConversionException if the conversion is not supported or incomplete or invalid character or multibyte sequence was found.

Definition at line 261 of file IConv.cpp.

References BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::IConv_t::convert(), BLOCXX_NAMESPACE::String::empty(), BLOCXX_NAMESPACE::String::length(), and mayThrowStringConversionException().


Generated on Fri Jun 16 15:39:12 2006 for blocxx by  doxygen 1.4.6