Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::TextEncoding Class Reference

#include <TextEncoding.h>

Inheritance diagram for Poco::TextEncoding:

Poco::ASCIIEncoding Poco::Latin1Encoding Poco::Latin9Encoding Poco::UTF16Encoding Poco::UTF8Encoding Poco::Windows1252Encoding

List of all members.


Detailed Description

An abstract base class for implementing text encodings like UTF-8 or ISO 8859-1.

Subclasses must override the canonicalName(), isA(), characterMap() and convert() methods and need to be thread safe and stateless.

TextEncoding also provides static member functions for managing mappings from encoding names to TextEncoding objects.

Definition at line 53 of file TextEncoding.h.


Public Types

enum  { MAX_SEQUENCE_LENGTH = 6 }
typedef int CharacterMap [256]
typedef SharedPtr< TextEncodingPtr

Public Member Functions

virtual const char * canonicalName () const =0
 Destroys the encoding.
virtual const CharacterMap & characterMap () const =0
virtual int convert (int ch, unsigned char *bytes, int length) const
virtual int convert (const unsigned char *bytes) const
virtual bool isA (const std::string &encodingName) const =0
virtual int queryConvert (const unsigned char *bytes, int length) const
virtual int sequenceLength (const unsigned char *bytes, int length) const
virtual ~TextEncoding ()

Static Public Member Functions

static void add (TextEncoding::Ptr encoding, const std::string &name)
static void add (TextEncoding::Ptr encoding)
static TextEncodingbyName (const std::string &encodingName)
static TextEncoding::Ptr find (const std::string &encodingName)
static TextEncodingglobal ()
static TextEncoding::Ptr global (TextEncoding::Ptr encoding)
static void remove (const std::string &encodingName)

Static Public Attributes

static const std::string GLOBAL
 Return the current global TextEncoding object.

Static Protected Member Functions

static TextEncodingManager & manager ()
 Name of the global TextEncoding, which is the empty string.

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

Generated by  Doxygen 1.6.0   Back to index