Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::UnicodeString Class Reference

The UnicodeString class represents a thin wrapper around the std::basic_string class since std::basic_string cannot be derived from (it has no virtual destructor). More...

#include <vcf/FoundationKit/VCFString.h>

List of all members.

Public Types

typedef char AnsiChar
typedef VCF::WideChar UniChar
typedef std::basic_string<
UniChar
StringData
typedef StringData::size_type size_type
typedef StringData::traits_type traits_type
typedef StringData::allocator_type allocator_type
typedef UniChar char_type
typedef StringData::difference_type difference_type
typedef StringData::pointer pointer
typedef StringData::const_pointer const_pointer
typedef StringData::reference reference
typedef StringData::const_reference const_reference
typedef StringData::value_type value_type
typedef StringData::iterator iterator
typedef StringData::const_iterator const_iterator
typedef StringData::reverse_iterator reverse_iterator
typedef StringData::const_reverse_iterator const_reverse_iterator
enum  LanguageEncoding {
  leUnknown = -1, leDefault = 0, leIBM037 = 100, leIBM437,
  leIBM500, leArabic708, leArabic449, leArabicTransparent,
  leDOSArabic, leGreek, leBaltic, leLatin1,
  leLatin2, leCyrillic, leTurkish, leMultilingualLatin1,
  lePortuguese, leIcelandic, leHebrew, leFrenchCanadian,
  leArabic864, leNordic, leRussianCyrillic, leModernGreek,
  leEBCDICLatin2, leThai, leEBCDICGreekModern, leShiftJIS,
  leSimplifiedChinese, leKorean, leChineseTraditionalBig5, leEBCDICTurkish,
  leEBCDICLatin1, leEBCDICUSCanada, leEBCDICGermany, leEBCDICDenmarkNorway,
  leEBCDICFinlandSweden, leEBCDICItaly, leEBCDICLatinAmericaSpain, leEBCDICUnitedKingdom,
  leEBCDICFrance, leEBCDICInternational, leEBCDICIcelandic, leUTF16LittleEndianByteOrder,
  leUTF16BigEndianByteOrder, leANSICentralEuropean, leANSICyrillic, leANSILatin1,
  leANSIGreek, leANSITurkish, leANSIHebrew, leANSIArabic,
  leANSIBaltic, leANSIVietnamese, leJohabKorean, leMacRoman,
  leMacJapanese, leMacTraditionalChineseBig5, leMacKorean, leMacArabic,
  leMacHebrew, leMacGreek, leMacCyrillic, leMacSimplifiedChinese,
  leMacRomanian, leMacUkrainian, leMacThai, leMacLatin2,
  leMacIcelandic, leMacTurkish, leMacCroatian, leUTF32LittleEndianByteOrder,
  leUTF32BigEndianByteOrder, leCNSTaiwan, leTCATaiwan, leEtenTaiwan,
  leIBM5550Taiwan, leTeleTextTaiwan, leWangTaiwan, leIA5WesternEuropean,
  leIA5German, leIA5Swedish, leIA5Norwegian, leUSASCII,
  leT61, leISO6937, leIBM273Germany, leIBM277DenmarkNorway,
  leIBM278FinlandSweden, leIBM280Italy, leIBM284LatinAmericaSpain, leIBM285UnitedKingdom,
  leIBM290JapaneseKatakanaExt, leIBM297France, leIBM420Arabic, leIBM423Greek,
  leIBM424Hebrew, leIBMKoreanExtended, leIBMThai, leRussianKOI8R,
  leIBM871Icelandic, leIBM880CyrillicRussian, leIBM905Turkish, leIBM00924Latin1,
  leEUCJapaneseJIS, leSimplifiedChineseGB2312, leKoreanWansung, leEBCDICCyrillicSerbianBulgarian,
  leUkrainianKOI8U, leISO88591Latin1, leISO88592CentralEuropean, leISO88593Latin3,
  leISO88594Baltic, leISO88595Cyrillic, leISO88596Arabic, leISO88597Greek,
  leISO88598HebrewVisual, leISO88599Turkish, leISO885913Estonian, leISO885915Latin9,
  leEuropa3, leISO88598HebrewLogical, leISO2022JapaneseNoHalfwidthKatakana, leISO2022JapaneseWithHalfwidthKatakana,
  leISO2022JapaneseAllow1ByteKana, leISO2022Korean, leISO2022SimplifiedChinese, leISO2022TraditionalChinese,
  leEBCDICJapaneseExt, leEBCDICUSCanadaAndJapanese, leEBCDICKoreanExtAndKorean, leEBCDICSimplifiedChineseExtSimplifiedChinese,
  leEBCDICSimplifiedChinese, leEBCDICUSCanadaAndTraditionalChinese, leEBCDICJapaneseLatinExtAndJapanese, leEUCJapanese,
  leEUCSimplifiedChinese, leEUCKorean, leEUCTraditionalChinese, leHZGB2312SimplifiedChinese,
  leGB18030SimplifiedChinese, leISCIIDevanagari, leISCIIBengali, leISCIITamil,
  leISCIITelugu, leISCIIAssamese, leISCIIOriya, leISCIIKannada,
  leISCIIMalayalam, leISCIIGujarati, leISCIIPunjabi, leUTF7,
  leUTF8
}
 Code page values for the locale:. More...
enum  {
  npos = (unsigned int)-1, UTF8BOMSize = sizeof(uchar) * 3, UTF16BOMSize = sizeof(ushort), UTF32BOMSize = sizeof(uint32),
  UTF8BOM = 0xEFBBBF, UTF16LittleEndianBOM = 0xFFFE, UTF16BigEndianBOM = 0xFEFF, UTF32LittleEndianBOM = 0xFFFE0000,
  UTF32BigEndianBOM = 0x0000FEFF
}

Public Member Functions

 ~UnicodeString ()
 UnicodeString ()
 UnicodeString (const UnicodeString &rhs)
 UnicodeString (const StringData &rhs)
 UnicodeString (const std::string &rhs, LanguageEncoding encoding=leDefault)
 UnicodeString (const AnsiChar *string, size_type stringLength, LanguageEncoding encoding=leDefault)
 UnicodeString (const UniChar *string, size_type stringLength)
 UnicodeString (const AnsiChar *string, LanguageEncoding encoding=leDefault)
 UnicodeString (const UniChar *string)
 UnicodeString (size_type n, AnsiChar c, LanguageEncoding encoding=leDefault)
 UnicodeString (size_type n, UniChar c)
void decode_ansi (TextCodec *codec, AnsiChar *str, size_type &strSize, LanguageEncoding encoding=leDefault) const
 Decodes the unicode data in this string and places the data in the ansi string buffer passed in.
UnicodeString decode (TextCodec *codec, LanguageEncoding encoding=leDefault) const
 Decodes the unicode data in the string and returns a new string with the decoded data as determined by the text codec.
void encode (TextCodec *codec, const AnsiChar *str, size_type n, LanguageEncoding encoding=leDefault)
 This encodes the ansi string into unicode, according to the algorithms in the codec, and replaces the data in the string's data_ value.
void encode (TextCodec *codec, const UnicodeString &str, LanguageEncoding encoding=leDefault)
 This encodes the data in the unicode string into another unicode string, according to the algorithms in the codec, and replaces the data in the string's data_ value.
const AnsiCharansi_c_str (LanguageEncoding encoding=leDefault) const
 Returns a const char* pointer.
 operator const StringData & () const
 This is a convenience function to get at the string's underlying data as a const std::basic_string.
 operator StringData & ()
 This is a convenience function to get at the string's underlying data as a const std::basic_string.
 operator AnsiString () const
 This is a convenience function that converts the string's data from unicode to ansi, and returns a std::basic_string<AnsiChar> (also known as std::string).
UnicodeStringoperator= (const UnicodeString &rhs)
UnicodeStringoperator= (const AnsiString &s)
UnicodeStringoperator= (const AnsiChar *s)
UnicodeStringoperator= (const UniChar *s)
UnicodeStringoperator= (AnsiChar c)
UnicodeStringoperator= (UniChar c)
bool operator== (const StringData &rhs) const
bool operator== (const UniChar *rhs) const
bool operator!= (const StringData &rhs) const
bool operator!= (const UniChar *rhs) const
bool operator< (const StringData &rhs) const
bool operator< (const UniChar *rhs) const
bool operator<= (const StringData &rhs) const
bool operator<= (const UniChar *rhs) const
bool operator> (const StringData &rhs) const
bool operator> (const UniChar *rhs) const
bool operator>= (const StringData &rhs) const
bool operator>= (const UniChar *rhs) const
bool operator== (const AnsiChar *rhs) const
bool operator!= (const AnsiChar *rhs) const
bool operator> (const AnsiChar *rhs) const
bool operator>= (const AnsiChar *rhs) const
bool operator< (const AnsiChar *rhs) const
bool operator<= (const AnsiChar *rhs) const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
const_reference at (size_type pos) const
reference at (size_type pos)
const_reference operator[] (size_type pos) const
reference operator[] (size_type pos)
const UniCharc_str () const
const UniChardata () const
size_type length () const
size_type size () const
 Returns the number of characters in the string.
size_type size_in_bytes () const
 The number of bytes that make up this string.
size_type max_size () const
void resize (size_type n, UniChar c=UniChar())
size_type capacity () const
void reserve (size_type n=0)
bool empty () const
UnicodeStringoperator+= (const UnicodeString &rhs)
UnicodeStringoperator+= (const UniChar *s)
UnicodeStringoperator+= (UniChar c)
UnicodeStringoperator+= (AnsiChar c)
UnicodeStringoperator+= (const AnsiChar *rhs)
UnicodeStringappend (const UnicodeString &str)
UnicodeStringappend (const UnicodeString &str, size_type pos, size_type n)
UnicodeStringappend (const UniChar *s, size_type n)
UnicodeStringappend (const AnsiChar *s, size_type n)
UnicodeStringappend (const UniChar *s)
UnicodeStringappend (const AnsiChar *s)
UnicodeStringappend (size_type n, UniChar c)
UnicodeStringappend (size_type n, AnsiChar c)
UnicodeStringappend (const_iterator first, const_iterator last)
UnicodeStringassign (const UnicodeString &str)
UnicodeStringassign (const UnicodeString &str, size_type pos, size_type n)
UnicodeStringassign (const UniChar *s, size_type n)
UnicodeStringassign (const UniChar *s)
UnicodeStringassign (size_type n, UniChar c)
UnicodeStringassign (const AnsiChar *s, size_type n)
UnicodeStringassign (const AnsiChar *s)
UnicodeStringassign (size_type n, AnsiChar c)
UnicodeStringassign (const_iterator first, const_iterator last)
UnicodeStringinsert (size_type p0, const UnicodeString &str)
UnicodeStringinsert (size_type p0, const UnicodeString &str, size_type pos, size_type n)
UnicodeStringinsert (size_type p0, const AnsiChar *s, size_type n)
UnicodeStringinsert (size_type p0, const UniChar *s, size_type n)
UnicodeStringinsert (size_type p0, const AnsiChar *s)
UnicodeStringinsert (size_type p0, const UniChar *s)
UnicodeStringinsert (size_type p0, size_type n, AnsiChar c)
UnicodeStringinsert (size_type p0, size_type n, UniChar c)
iterator insert (iterator it, AnsiChar c)
iterator insert (iterator it, UniChar c)
void insert (iterator it, size_type n, AnsiChar c)
void insert (iterator it, size_type n, UniChar c)
void insert (iterator it, const_iterator first, const_iterator last)
UnicodeStringerase (size_type p0=0, size_type n=npos)
iterator erase (iterator it)
iterator erase (iterator first, iterator last)
UnicodeStringreplace (size_type p0, size_type n0, const UnicodeString &str)
UnicodeStringreplace (size_type p0, size_type n0, const UnicodeString &str, size_type pos, size_type n)
UnicodeStringreplace (size_type p0, size_type n0, const AnsiChar *s, size_type n)
UnicodeStringreplace (size_type p0, size_type n0, const UniChar *s, size_type n)
UnicodeStringreplace (size_type p0, size_type n0, const AnsiChar *s)
UnicodeStringreplace (size_type p0, size_type n0, const UniChar *s)
UnicodeStringreplace (size_type p0, size_type n0, size_type n, AnsiChar c)
UnicodeStringreplace (size_type p0, size_type n0, size_type n, UniChar c)
UnicodeStringreplace (iterator first0, iterator last0, const UnicodeString &str)
UnicodeStringreplace (iterator first0, iterator last0, const AnsiChar *s, size_type n)
UnicodeStringreplace (iterator first0, iterator last0, const UniChar *s, size_type n)
UnicodeStringreplace (iterator first0, iterator last0, const AnsiChar *s)
UnicodeStringreplace (iterator first0, iterator last0, const UniChar *s)
UnicodeStringreplace (iterator first0, iterator last0, size_type n, AnsiChar c)
UnicodeStringreplace (iterator first0, iterator last0, size_type n, UniChar c)
UnicodeStringreplace (iterator first0, iterator last0, const_iterator first, const_iterator last)
size_type copy (AnsiChar *s, size_type n, size_type pos=0) const
size_type copy (UniChar *s, size_type n, size_type pos=0) const
void swap (UnicodeString &str)
size_type find (const UnicodeString &str, size_type pos=0) const
size_type find (const AnsiChar *s, size_type pos, size_type n) const
size_type find (const UniChar *s, size_type pos, size_type n) const
size_type find (const AnsiChar *s, size_type pos=0) const
size_type find (const UniChar *s, size_type pos=0) const
size_type find (AnsiChar c, size_type pos=0) const
size_type find (UniChar c, size_type pos=0) const
size_type rfind (const UnicodeString &str, size_type pos=npos) const
size_type rfind (const AnsiChar *s, size_type pos, size_type n=npos) const
size_type rfind (const UniChar *s, size_type pos, size_type n=npos) const
size_type rfind (const AnsiChar *s, size_type pos=npos) const
size_type rfind (const UniChar *s, size_type pos=npos) const
size_type rfind (AnsiChar c, size_type pos=npos) const
size_type rfind (UniChar c, size_type pos=npos) const
size_type find_first_of (const UnicodeString &str, size_type pos=0) const
size_type find_first_of (const AnsiChar *s, size_type pos, size_type n) const
size_type find_first_of (const UniChar *s, size_type pos, size_type n) const
size_type find_first_of (const AnsiChar *s, size_type pos=0) const
size_type find_first_of (const UniChar *s, size_type pos=0) const
size_type find_first_of (AnsiChar c, size_type pos=0) const
size_type find_first_of (UniChar c, size_type pos=0) const
size_type find_last_of (const UnicodeString &str, size_type pos=npos) const
size_type find_last_of (const AnsiChar *s, size_type pos, size_type n=npos) const
size_type find_last_of (const UniChar *s, size_type pos, size_type n=npos) const
size_type find_last_of (const AnsiChar *s, size_type pos=npos) const
size_type find_last_of (const UniChar *s, size_type pos=npos) const
size_type find_last_of (AnsiChar c, size_type pos=npos) const
size_type find_last_of (UniChar c, size_type pos=npos) const
size_type find_first_not_of (const UnicodeString &str, size_type pos=0) const
size_type find_first_not_of (const AnsiChar *s, size_type pos, size_type n) const
size_type find_first_not_of (const UniChar *s, size_type pos, size_type n) const
size_type find_first_not_of (const AnsiChar *s, size_type pos=0) const
size_type find_first_not_of (const UniChar *s, size_type pos=0) const
size_type find_first_not_of (AnsiChar c, size_type pos=0) const
size_type find_first_not_of (UniChar c, size_type pos=0) const
size_type find_last_not_of (const UnicodeString &str, size_type pos=npos) const
size_type find_last_not_of (const AnsiChar *s, size_type pos, size_type n) const
size_type find_last_not_of (const UniChar *s, size_type pos, size_type n) const
size_type find_last_not_of (const AnsiChar *s, size_type pos=npos) const
size_type find_last_not_of (const UniChar *s, size_type pos=npos) const
size_type find_last_not_of (AnsiChar c, size_type pos=npos) const
size_type find_last_not_of (UniChar c, size_type pos=npos) const
UnicodeString substr (size_type pos=0, size_type n=npos) const
int compare (const UnicodeString &str) const
int compare (size_type p0, size_type n0, const UnicodeString &str)
int compare (size_type p0, size_type n0, const UnicodeString &str, size_type pos, size_type n)
int compare (const AnsiChar *s) const
int compare (const UniChar *s) const
int compare (size_type p0, size_type n0, const AnsiChar *s) const
int compare (size_type p0, size_type n0, const UniChar *s) const
int compare (size_type p0, size_type n0, const AnsiChar *s, size_type pos) const
int compare (size_type p0, size_type n0, const UniChar *s, size_type pos) const
uint64 sizeOf () const

Static Public Member Functions

static void transformAnsiToUnicode (const AnsiChar *str, size_type stringLength, StringData &newStr, LanguageEncoding encoding=leDefault)
static AnsiChartransformUnicodeToAnsi (const UnicodeString &str, LanguageEncoding encoding=leDefault)
static UniChar transformAnsiCharToUnicodeChar (AnsiChar c, LanguageEncoding encoding=leDefault)
static AnsiChar transformUnicodeCharToAnsiChar (UniChar c, LanguageEncoding encoding=leDefault)
static int adjustForBOMMarker (AnsiChar *&stringPtr, uint32 &len)

Protected Member Functions

void modified ()

Protected Attributes

StringData data_
AnsiCharansiDataBuffer_

Friends

bool operator== (const UnicodeString &lhs, const UnicodeString &rhs)
bool operator!= (const UnicodeString &lhs, const UnicodeString &rhs)
bool operator< (const UnicodeString &lhs, const UnicodeString &rhs)
bool operator<= (const UnicodeString &lhs, const UnicodeString &rhs)
bool operator> (const UnicodeString &lhs, const UnicodeString &rhs)
bool operator>= (const UnicodeString &lhs, const UnicodeString &rhs)


Detailed Description

The UnicodeString class represents a thin wrapper around the std::basic_string class since std::basic_string cannot be derived from (it has no virtual destructor).

The type of std::basic_string is a std::basic_string<wchar_t> meaning that the string class maintains unicode data internally.

The main purpose of the String class is to provide a drop in replacement for std::basic_string<wchar_t>, with an interface that is 100% compatible. In addition we add a few extra functions of our own:

These extra functions make it seamless to use with existing code that uses either old C style strings and/or std::string/stdwstring instances. For complete documentation of the std::basic_string, please see SGI's documentation.

Another set of functions is used to encode or decode text using a particular text codec isntance as specified by the TextCodec class. These encoding/decoding methods are:

In addition there are also a whole series of typedefs, again solely to make the class compatible with the std::basic_string class.


Member Typedef Documentation

typedef StringData::allocator_type VCF::UnicodeString::allocator_type
 

typedef char VCF::UnicodeString::AnsiChar
 

typedef UniChar VCF::UnicodeString::char_type
 

typedef StringData::const_iterator VCF::UnicodeString::const_iterator
 

typedef StringData::const_pointer VCF::UnicodeString::const_pointer
 

typedef StringData::const_reference VCF::UnicodeString::const_reference
 

typedef StringData::const_reverse_iterator VCF::UnicodeString::const_reverse_iterator
 

typedef StringData::difference_type VCF::UnicodeString::difference_type
 

typedef StringData::iterator VCF::UnicodeString::iterator
 

typedef StringData::pointer VCF::UnicodeString::pointer
 

typedef StringData::reference VCF::UnicodeString::reference
 

typedef StringData::reverse_iterator VCF::UnicodeString::reverse_iterator
 

typedef StringData::size_type VCF::UnicodeString::size_type
 

typedef std::basic_string<UniChar> VCF::UnicodeString::StringData
 

typedef StringData::traits_type VCF::UnicodeString::traits_type
 

typedef VCF::WideChar VCF::UnicodeString::UniChar
 

typedef StringData::value_type VCF::UnicodeString::value_type
 


Member Enumeration Documentation

anonymous enum
 

Enumerator:
npos 
UTF8BOMSize 
UTF16BOMSize 
UTF32BOMSize 
UTF8BOM 
UTF16LittleEndianBOM 
UTF16BigEndianBOM 
UTF32LittleEndianBOM 
UTF32BigEndianBOM 

enum VCF::UnicodeString::LanguageEncoding
 

Code page values for the locale:.

Enumerator:
leUnknown 
leDefault 
leIBM037 
leIBM437 
leIBM500 
leArabic708 
leArabic449 
leArabicTransparent 
leDOSArabic 
leGreek 
leBaltic 
leLatin1 
leLatin2 
leCyrillic 
leTurkish 
leMultilingualLatin1 
lePortuguese 
leIcelandic 
leHebrew 
leFrenchCanadian 
leArabic864 
leNordic 
leRussianCyrillic 
leModernGreek 
leEBCDICLatin2 
leThai 
leEBCDICGreekModern 
leShiftJIS 
leSimplifiedChinese 
leKorean 
leChineseTraditionalBig5 
leEBCDICTurkish 
leEBCDICLatin1 
leEBCDICUSCanada 
leEBCDICGermany 
leEBCDICDenmarkNorway 
leEBCDICFinlandSweden 
leEBCDICItaly 
leEBCDICLatinAmericaSpain 
leEBCDICUnitedKingdom 
leEBCDICFrance 
leEBCDICInternational 
leEBCDICIcelandic 
leUTF16LittleEndianByteOrder 
leUTF16BigEndianByteOrder 
leANSICentralEuropean 
leANSICyrillic 
leANSILatin1 
leANSIGreek 
leANSITurkish 
leANSIHebrew 
leANSIArabic 
leANSIBaltic 
leANSIVietnamese 
leJohabKorean 
leMacRoman 
leMacJapanese 
leMacTraditionalChineseBig5 
leMacKorean 
leMacArabic 
leMacHebrew 
leMacGreek 
leMacCyrillic 
leMacSimplifiedChinese 
leMacRomanian 
leMacUkrainian 
leMacThai 
leMacLatin2 
leMacIcelandic 
leMacTurkish 
leMacCroatian 
leUTF32LittleEndianByteOrder 
leUTF32BigEndianByteOrder 
leCNSTaiwan 
leTCATaiwan 
leEtenTaiwan 
leIBM5550Taiwan 
leTeleTextTaiwan 
leWangTaiwan 
leIA5WesternEuropean 
leIA5German 
leIA5Swedish 
leIA5Norwegian 
leUSASCII 
leT61 
leISO6937 
leIBM273Germany 
leIBM277DenmarkNorway 
leIBM278FinlandSweden 
leIBM280Italy 
leIBM284LatinAmericaSpain 
leIBM285UnitedKingdom 
leIBM290JapaneseKatakanaExt 
leIBM297France 
leIBM420Arabic 
leIBM423Greek 
leIBM424Hebrew 
leIBMKoreanExtended 
leIBMThai 
leRussianKOI8R 
leIBM871Icelandic 
leIBM880CyrillicRussian 
leIBM905Turkish 
leIBM00924Latin1 
leEUCJapaneseJIS 
leSimplifiedChineseGB2312 
leKoreanWansung 
leEBCDICCyrillicSerbianBulgarian 
leUkrainianKOI8U 
leISO88591Latin1 
leISO88592CentralEuropean 
leISO88593Latin3 
leISO88594Baltic 
leISO88595Cyrillic 
leISO88596Arabic 
leISO88597Greek 
leISO88598HebrewVisual 
leISO88599Turkish 
leISO885913Estonian 
leISO885915Latin9 
leEuropa3 
leISO88598HebrewLogical 
leISO2022JapaneseNoHalfwidthKatakana 
leISO2022JapaneseWithHalfwidthKatakana 
leISO2022JapaneseAllow1ByteKana 
leISO2022Korean 
leISO2022SimplifiedChinese 
leISO2022TraditionalChinese 
leEBCDICJapaneseExt 
leEBCDICUSCanadaAndJapanese 
leEBCDICKoreanExtAndKorean 
leEBCDICSimplifiedChineseExtSimplifiedChinese 
leEBCDICSimplifiedChinese 
leEBCDICUSCanadaAndTraditionalChinese 
leEBCDICJapaneseLatinExtAndJapanese 
leEUCJapanese 
leEUCSimplifiedChinese 
leEUCKorean 
leEUCTraditionalChinese 
leHZGB2312SimplifiedChinese 
leGB18030SimplifiedChinese 
leISCIIDevanagari 
leISCIIBengali 
leISCIITamil 
leISCIITelugu 
leISCIIAssamese 
leISCIIOriya 
leISCIIKannada 
leISCIIMalayalam 
leISCIIGujarati 
leISCIIPunjabi 
leUTF7 
leUTF8 


Constructor & Destructor Documentation

VCF::UnicodeString::~UnicodeString  ) 
 

VCF::UnicodeString::UnicodeString  )  [inline]
 

VCF::UnicodeString::UnicodeString const UnicodeString rhs  )  [inline]
 

VCF::UnicodeString::UnicodeString const StringData rhs  )  [inline]
 

VCF::UnicodeString::UnicodeString const std::string &  rhs,
LanguageEncoding  encoding = leDefault
 

VCF::UnicodeString::UnicodeString const AnsiChar string,
size_type  stringLength,
LanguageEncoding  encoding = leDefault
 

VCF::UnicodeString::UnicodeString const UniChar string,
size_type  stringLength
 

VCF::UnicodeString::UnicodeString const AnsiChar string,
LanguageEncoding  encoding = leDefault
 

VCF::UnicodeString::UnicodeString const UniChar string  ) 
 

VCF::UnicodeString::UnicodeString size_type  n,
AnsiChar  c,
LanguageEncoding  encoding = leDefault
 

VCF::UnicodeString::UnicodeString size_type  n,
UniChar  c
 


Member Function Documentation

static int VCF::UnicodeString::adjustForBOMMarker AnsiChar *&  stringPtr,
uint32 len
[static]
 

const AnsiChar* VCF::UnicodeString::ansi_c_str LanguageEncoding  encoding = leDefault  )  const
 

Returns a const char* pointer.

Equivalent to the c_str() method, only this translates the internal unicode data to an ansi string.

Please note that the pointer returned from this function is only valid for the lifetime of the string that it was returned from. Calling this function requires that a new char buffer be allocated. As a result of this, the string instance that allocates this buffer manages the memory for it and when the string instance is destroyed, all allocated ansi string buffers that were allocated as a result of a call to this method are also destroyed. If a caller needs to maintain this char string beyond the lifetime of the string instance it was retreived from, they should copy it to a new buffer, or perhaps a std::string instance. An example of this might look like:

    std::string localString;
    const char* strPtr = NULL;
    {
        String s = "Hello World"; //new string instance. "Hello World" is stored as unicode

        strPtr = s.ansi_c_str();

        printf( "%s", strPtr ); //strPtr now points to an ansi string allocated by the s UnicodeString instance.

        localString = strPtr; //make a copy of strPtr and store in our std::string variable

    } //s falls out of scope, and is destroyed, reclaiming all allocated char* buffers due to ansi_c_str() calls

    printf( "%s", strPtr ); //oops! strPtr will point to garbage now!

    printf( "%s", localString.c_str() );  //however localString is OK because it is a copy from strPtr

UnicodeString& VCF::UnicodeString::append const_iterator  first,
const_iterator  last
[inline]
 

UnicodeString& VCF::UnicodeString::append size_type  n,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::append size_type  n,
UniChar  c
[inline]
 

UnicodeString& VCF::UnicodeString::append const AnsiChar s  ) 
 

UnicodeString& VCF::UnicodeString::append const UniChar s  )  [inline]
 

UnicodeString& VCF::UnicodeString::append const AnsiChar s,
size_type  n
 

UnicodeString& VCF::UnicodeString::append const UniChar s,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::append const UnicodeString str,
size_type  pos,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::append const UnicodeString str  )  [inline]
 

UnicodeString& VCF::UnicodeString::assign const_iterator  first,
const_iterator  last
[inline]
 

UnicodeString& VCF::UnicodeString::assign size_type  n,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::assign const AnsiChar s  ) 
 

UnicodeString& VCF::UnicodeString::assign const AnsiChar s,
size_type  n
 

UnicodeString& VCF::UnicodeString::assign size_type  n,
UniChar  c
[inline]
 

UnicodeString& VCF::UnicodeString::assign const UniChar s  )  [inline]
 

UnicodeString& VCF::UnicodeString::assign const UniChar s,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::assign const UnicodeString str,
size_type  pos,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::assign const UnicodeString str  )  [inline]
 

reference VCF::UnicodeString::at size_type  pos  )  [inline]
 

const_reference VCF::UnicodeString::at size_type  pos  )  const [inline]
 

const_iterator VCF::UnicodeString::begin  )  const [inline]
 

iterator VCF::UnicodeString::begin  )  [inline]
 

const UniChar* VCF::UnicodeString::c_str  )  const [inline]
 

size_type VCF::UnicodeString::capacity  )  const [inline]
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const UniChar s,
size_type  pos
const [inline]
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const AnsiChar s,
size_type  pos
const
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const UniChar s
const [inline]
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const AnsiChar s
const
 

int VCF::UnicodeString::compare const UniChar s  )  const [inline]
 

int VCF::UnicodeString::compare const AnsiChar s  )  const
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const UnicodeString str,
size_type  pos,
size_type  n
[inline]
 

int VCF::UnicodeString::compare size_type  p0,
size_type  n0,
const UnicodeString str
[inline]
 

int VCF::UnicodeString::compare const UnicodeString str  )  const [inline]
 

size_type VCF::UnicodeString::copy UniChar s,
size_type  n,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::copy AnsiChar s,
size_type  n,
size_type  pos = 0
const
 

const UniChar* VCF::UnicodeString::data  )  const [inline]
 

UnicodeString VCF::UnicodeString::decode TextCodec codec,
LanguageEncoding  encoding = leDefault
const
 

Decodes the unicode data in the string and returns a new string with the decoded data as determined by the text codec.

Parameters:
TextCodec the codec used to decode the string's data
Returns:
UnicodeString the new string that is created as a result of the decode process by the codec.

void VCF::UnicodeString::decode_ansi TextCodec codec,
AnsiChar str,
size_type strSize,
LanguageEncoding  encoding = leDefault
const
 

Decodes the unicode data in this string and places the data in the ansi string buffer passed in.

When the function returns the strSize variable will be modified to reflect the number of bytes written to the ansi string buffer.

Parameters:
TextCodec the code to use for decoding this string's data
AnsiChar* str the ansi buffer to use to write the decoded data to
size_type& strSize teh number of bytes in the str buffer. UIpon returning from this function this will hold the number of bytes actually written to the str buffer. The null terminator will be written out
See also:
ansi_c_str()

bool VCF::UnicodeString::empty  )  const [inline]
 

void VCF::UnicodeString::encode TextCodec codec,
const UnicodeString str,
LanguageEncoding  encoding = leDefault
 

This encodes the data in the unicode string into another unicode string, according to the algorithms in the codec, and replaces the data in the string's data_ value.

Parameters:
TextCodec* an instance of a TextCodec that represents the algorithm used in encoding the data stored in str.
UnicodeString the source unicode string to encode from

void VCF::UnicodeString::encode TextCodec codec,
const AnsiChar str,
size_type  n,
LanguageEncoding  encoding = leDefault
 

This encodes the ansi string into unicode, according to the algorithms in the codec, and replaces the data in the string's data_ value.

Parameters:
TextCodec* an instance of a TextCodec that represents the algorithm used in encoding the data stored in str.
AnsiChar* the source ansi string buffer
size_type the number of bytes to encode from the str buffer

const_iterator VCF::UnicodeString::end  )  const [inline]
 

iterator VCF::UnicodeString::end  )  [inline]
 

iterator VCF::UnicodeString::erase iterator  first,
iterator  last
[inline]
 

iterator VCF::UnicodeString::erase iterator  it  )  [inline]
 

UnicodeString& VCF::UnicodeString::erase size_type  p0 = 0,
size_type  n = npos
[inline]
 

size_type VCF::UnicodeString::find UniChar  c,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find AnsiChar  c,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find const UniChar s,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find const AnsiChar s,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find const UniChar s,
size_type  pos,
size_type  n
const [inline]
 

size_type VCF::UnicodeString::find const AnsiChar s,
size_type  pos,
size_type  n
const
 

size_type VCF::UnicodeString::find const UnicodeString str,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_not_of UniChar  c,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_not_of AnsiChar  c,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find_first_not_of const UniChar s,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_not_of const AnsiChar s,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find_first_not_of const UniChar s,
size_type  pos,
size_type  n
const [inline]
 

size_type VCF::UnicodeString::find_first_not_of const AnsiChar s,
size_type  pos,
size_type  n
const
 

size_type VCF::UnicodeString::find_first_not_of const UnicodeString str,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_of UniChar  c,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_of AnsiChar  c,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find_first_of const UniChar s,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_first_of const AnsiChar s,
size_type  pos = 0
const
 

size_type VCF::UnicodeString::find_first_of const UniChar s,
size_type  pos,
size_type  n
const [inline]
 

size_type VCF::UnicodeString::find_first_of const AnsiChar s,
size_type  pos,
size_type  n
const
 

size_type VCF::UnicodeString::find_first_of const UnicodeString str,
size_type  pos = 0
const [inline]
 

size_type VCF::UnicodeString::find_last_not_of UniChar  c,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_not_of AnsiChar  c,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::find_last_not_of const UniChar s,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_not_of const AnsiChar s,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::find_last_not_of const UniChar s,
size_type  pos,
size_type  n
const [inline]
 

size_type VCF::UnicodeString::find_last_not_of const AnsiChar s,
size_type  pos,
size_type  n
const
 

size_type VCF::UnicodeString::find_last_not_of const UnicodeString str,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_of UniChar  c,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_of AnsiChar  c,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::find_last_of const UniChar s,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_of const AnsiChar s,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::find_last_of const UniChar s,
size_type  pos,
size_type  n = npos
const [inline]
 

size_type VCF::UnicodeString::find_last_of const AnsiChar s,
size_type  pos,
size_type  n = npos
const
 

size_type VCF::UnicodeString::find_last_of const UnicodeString str,
size_type  pos = npos
const [inline]
 

void VCF::UnicodeString::insert iterator  it,
const_iterator  first,
const_iterator  last
[inline]
 

void VCF::UnicodeString::insert iterator  it,
size_type  n,
UniChar  c
[inline]
 

void VCF::UnicodeString::insert iterator  it,
size_type  n,
AnsiChar  c
 

iterator VCF::UnicodeString::insert iterator  it,
UniChar  c
[inline]
 

iterator VCF::UnicodeString::insert iterator  it,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
size_type  n,
UniChar  c
[inline]
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
size_type  n,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const UniChar s
[inline]
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const AnsiChar s
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const UniChar s,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const AnsiChar s,
size_type  n
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const UnicodeString str,
size_type  pos,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::insert size_type  p0,
const UnicodeString str
[inline]
 

size_type VCF::UnicodeString::length  )  const [inline]
 

size_type VCF::UnicodeString::max_size  )  const [inline]
 

void VCF::UnicodeString::modified  )  [inline, protected]
 

VCF::UnicodeString::operator AnsiString  )  const [inline]
 

This is a convenience function that converts the string's data from unicode to ansi, and returns a std::basic_string<AnsiChar> (also known as std::string).

Returns:
AnsiString a converted string

VCF::UnicodeString::operator const StringData &  )  const [inline]
 

This is a convenience function to get at the string's underlying data as a const std::basic_string.

Since it's a const reference, you can't modify anything on the basic_string reference returned.

    std::basic_string<UniChar> stlString;
    String myString = "Hello World";

    stlString = myString; //this makes a copy

    const std::basic_string<UniChar>& constRefString = myString; //this is a const reference - immutable
Returns:
std::basic_string<UniChar>& a const reference to the string's underlying std::basic_string member variable.

VCF::UnicodeString::operator StringData &  )  [inline]
 

This is a convenience function to get at the string's underlying data as a const std::basic_string.

Since it's a reference, you can modify the basic_string reference returned.

Returns:
std::basic_string<UniChar>& a reference to the string's underlying std::basic_string member variable.

bool VCF::UnicodeString::operator!= const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator!= const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator!= const StringData rhs  )  const [inline]
 

UnicodeString& VCF::UnicodeString::operator+= const AnsiChar rhs  ) 
 

UnicodeString& VCF::UnicodeString::operator+= AnsiChar  c  ) 
 

UnicodeString& VCF::UnicodeString::operator+= UniChar  c  )  [inline]
 

UnicodeString& VCF::UnicodeString::operator+= const UniChar s  )  [inline]
 

UnicodeString& VCF::UnicodeString::operator+= const UnicodeString rhs  )  [inline]
 

bool VCF::UnicodeString::operator< const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator< const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator< const StringData rhs  )  const [inline]
 

bool VCF::UnicodeString::operator<= const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator<= const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator<= const StringData rhs  )  const [inline]
 

UnicodeString& VCF::UnicodeString::operator= UniChar  c  )  [inline]
 

UnicodeString& VCF::UnicodeString::operator= AnsiChar  c  ) 
 

UnicodeString& VCF::UnicodeString::operator= const UniChar s  )  [inline]
 

UnicodeString& VCF::UnicodeString::operator= const AnsiChar s  ) 
 

UnicodeString& VCF::UnicodeString::operator= const AnsiString s  )  [inline]
 

UnicodeString& VCF::UnicodeString::operator= const UnicodeString rhs  )  [inline]
 

bool VCF::UnicodeString::operator== const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator== const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator== const StringData rhs  )  const [inline]
 

bool VCF::UnicodeString::operator> const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator> const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator> const StringData rhs  )  const [inline]
 

bool VCF::UnicodeString::operator>= const AnsiChar rhs  )  const
 

bool VCF::UnicodeString::operator>= const UniChar rhs  )  const [inline]
 

bool VCF::UnicodeString::operator>= const StringData rhs  )  const [inline]
 

reference VCF::UnicodeString::operator[] size_type  pos  )  [inline]
 

const_reference VCF::UnicodeString::operator[] size_type  pos  )  const [inline]
 

const_reverse_iterator VCF::UnicodeString::rbegin  )  const [inline]
 

reverse_iterator VCF::UnicodeString::rbegin  )  [inline]
 

const_reverse_iterator VCF::UnicodeString::rend  )  const [inline]
 

reverse_iterator VCF::UnicodeString::rend  )  [inline]
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const_iterator  first,
const_iterator  last
[inline]
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
size_type  n,
UniChar  c
[inline]
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
size_type  n,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const UniChar s
[inline]
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const AnsiChar s
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const UniChar s,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const AnsiChar s,
size_type  n
 

UnicodeString& VCF::UnicodeString::replace iterator  first0,
iterator  last0,
const UnicodeString str
[inline]
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
size_type  n,
UniChar  c
[inline]
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
size_type  n,
AnsiChar  c
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const UniChar s
[inline]
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const AnsiChar s
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const UniChar s,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const AnsiChar s,
size_type  n
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const UnicodeString str,
size_type  pos,
size_type  n
[inline]
 

UnicodeString& VCF::UnicodeString::replace size_type  p0,
size_type  n0,
const UnicodeString str
[inline]
 

void VCF::UnicodeString::reserve size_type  n = 0  )  [inline]
 

void VCF::UnicodeString::resize size_type  n,
UniChar  c = UniChar()
[inline]
 

size_type VCF::UnicodeString::rfind UniChar  c,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::rfind AnsiChar  c,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::rfind const UniChar s,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::rfind const AnsiChar s,
size_type  pos = npos
const
 

size_type VCF::UnicodeString::rfind const UniChar s,
size_type  pos,
size_type  n = npos
const [inline]
 

size_type VCF::UnicodeString::rfind const AnsiChar s,
size_type  pos,
size_type  n = npos
const
 

size_type VCF::UnicodeString::rfind const UnicodeString str,
size_type  pos = npos
const [inline]
 

size_type VCF::UnicodeString::size  )  const [inline]
 

Returns the number of characters in the string.

This is not the same as the number of bytes that make up the string.

See also:
size_in_bytes()

size_type VCF::UnicodeString::size_in_bytes  )  const [inline]
 

The number of bytes that make up this string.

This is current the size of the string times the size of a single character (which is 16 bits, or 2 bytes).

uint64 VCF::UnicodeString::sizeOf  )  const
 

UnicodeString VCF::UnicodeString::substr size_type  pos = 0,
size_type  n = npos
const [inline]
 

void VCF::UnicodeString::swap UnicodeString str  )  [inline]
 

static UniChar VCF::UnicodeString::transformAnsiCharToUnicodeChar AnsiChar  c,
LanguageEncoding  encoding = leDefault
[static]
 

static void VCF::UnicodeString::transformAnsiToUnicode const AnsiChar str,
size_type  stringLength,
StringData newStr,
LanguageEncoding  encoding = leDefault
[static]
 

static AnsiChar VCF::UnicodeString::transformUnicodeCharToAnsiChar UniChar  c,
LanguageEncoding  encoding = leDefault
[static]
 

static AnsiChar* VCF::UnicodeString::transformUnicodeToAnsi const UnicodeString str,
LanguageEncoding  encoding = leDefault
[static]
 


Friends And Related Function Documentation

bool operator!= const UnicodeString lhs,
const UnicodeString rhs
[friend]
 

bool operator< const UnicodeString lhs,
const UnicodeString rhs
[friend]
 

bool operator<= const UnicodeString lhs,
const UnicodeString rhs
[friend]
 

bool operator== const UnicodeString lhs,
const UnicodeString rhs
[friend]
 

bool operator> const UnicodeString lhs,
const UnicodeString rhs
[friend]
 

bool operator>= const UnicodeString lhs,
const UnicodeString rhs
[friend]
 


Member Data Documentation

AnsiChar* VCF::UnicodeString::ansiDataBuffer_ [mutable, protected]
 

StringData VCF::UnicodeString::data_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information