All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Static Protected Member Functions | Friends
GUI::NativeString< STR > Class Template Reference

Converts between strings of various types and String objects. More...

#include <gui_tk.h>

List of all members.

Static Protected Member Functions

static void getString (String &dest, const STR &src)
 Converts a native string into a String object.
static STR & getNative (const String &src)
 Converts a string object to native representation.


class String

Detailed Description

template<typename STR>
class GUI::NativeString< STR >

Converts between strings of various types and String objects.

It is used to deal with string encoding. It is intended to be used with template specializations. Having such a specialization means you can feed the corresponding type to all functions that expect a string -- without any conversion. You can add specializations yourself in your program's code to deal with unsupported types.

As an example, see the std::string version.

Encodings, as opposed to character sets, define how bytes map to character values. ASCII, for example, has an encoding where each byte is one character, while the ASCII character set says that values 0-127 are valid and 65 is the upper case letter 'A'. UTF-8 has 1-6 bytes per character, and the character set is unicode.

GUI::Font deals with the character set, and this class encapsulates encodings.

Definition at line 324 of file gui_tk.h.

Member Function Documentation

template<typename STR >
static STR& GUI::NativeString< STR >::getNative ( const String src) [inline, static, protected]

Converts a string object to native representation.

If some characters cannot be converted, they should silently be skipped. Apart from that, nativeString(stringNative(String(),X)) should be value-equal to X.

Definition at line 336 of file gui_tk.h.

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