#include <CeylanUnicode.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
UnicodeString () | |
Constructs an empty Unicode string. | |
virtual | ~UnicodeString () throw () |
Virtual destructor. | |
virtual StringSize | size () const |
Returns the number of characters in this Unicode string. | |
virtual UnicodeString & | copy (bool swap=false) const |
Creates a new Unicode string which is the copy of this Unicode string. | |
virtual void | setFromLatin1 (const std::string &latin1String) |
Sets this string from the specified Latin-1 encoded string. | |
virtual void | setFromUTF8 (const std::string &utf8String, StringSize characterCount) |
Sets this string from the specified UTF-8 encoded string. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static Unicode | ConvertFromLatin1 (Ceylan::Latin1Char latin1Char) |
Converts specified Latin-1 encoded character to Unicode. | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Protected Member Functions | |
virtual void | setCapacity (StringSize newSize) |
Sets the internal character buffer so that it has the specified capacity. | |
Protected Attributes | |
Unicode * | _buffer |
The buffer storing Unicode characters. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
UnicodeString (const UnicodeString &source) | |
Copy constructor made private to ensure that it will never be called. | |
UnicodeString & | operator= (const UnicodeString &source) |
Assignment operator made private to ensure that it will never be called. |
A first UTF-8 (Unicode Transformation Format-8) encoding support is provided as well.
UTF-8 is the default encoding for XML.
Definition at line 68 of file CeylanUnicode.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
UnicodeString::UnicodeString | ( | ) |
Constructs an empty Unicode string.
Definition at line 47 of file CeylanUnicode.cc.
Referenced by copy().
UnicodeString::~UnicodeString | ( | ) | throw () [virtual] |
Ceylan::UnicodeString::UnicodeString | ( | const UnicodeString & | source | ) | [private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
Unicode UnicodeString::ConvertFromLatin1 | ( | Ceylan::Latin1Char | latin1Char | ) | [static] |
Converts specified Latin-1 encoded character to Unicode.
Definition at line 224 of file CeylanUnicode.cc.
UnicodeString & UnicodeString::copy | ( | bool | swap = false |
) | const [virtual] |
Creates a new Unicode string which is the copy of this Unicode string.
Ownership of the new string is transferred to the caller, which will have to deallocate it when not useful anymore.
Definition at line 90 of file CeylanUnicode.cc.
References _buffer, setCapacity(), size(), Ceylan::swapBytes(), and UnicodeString().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
UnicodeString& Ceylan::UnicodeString::operator= | ( | const UnicodeString & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void UnicodeString::setCapacity | ( | Ceylan::StringSize | newSize | ) | [protected, virtual] |
Sets the internal character buffer so that it has the specified capacity.
Definition at line 233 of file CeylanUnicode.cc.
References _buffer, and size().
Referenced by copy(), setFromLatin1(), and setFromUTF8().
void UnicodeString::setFromLatin1 | ( | const std::string & | latin1String | ) | [virtual] |
Sets this string from the specified Latin-1 encoded string.
latin1String | the Latin-1 encoded string which will be copied and encoded in Unicode in this string. |
Definition at line 132 of file CeylanUnicode.cc.
References _buffer, and setCapacity().
void UnicodeString::setFromUTF8 | ( | const std::string & | utf8String, | |
Ceylan::StringSize | characterCount | |||
) | [virtual] |
Sets this string from the specified UTF-8 encoded string.
utf8String | the UTF-8 encoded string which will be copied and encoded in Unicode in this string. | |
size | the number of characters encoded in the UTF-8 string (not the string size, since a UTF-8 character may be encoded in more than one byte). |
Definition at line 150 of file CeylanUnicode.cc.
References _buffer, and setCapacity().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
Ceylan::StringSize UnicodeString::size | ( | ) | const [virtual] |
Returns the number of characters in this Unicode string.
Definition at line 65 of file CeylanUnicode.cc.
References _buffer.
Referenced by copy(), setCapacity(), and toString().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string UnicodeString::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Definition at line 213 of file CeylanUnicode.cc.
References size().
Unicode* Ceylan::UnicodeString::_buffer [protected] |
The buffer storing Unicode characters.
Definition at line 172 of file CeylanUnicode.h.
Referenced by copy(), setCapacity(), setFromLatin1(), setFromUTF8(), size(), and ~UnicodeString().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().