OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ToUTF8::Utf8Encoder Class Reference

#include <to_utf8.hpp>

Collaboration diagram for ToUTF8::Utf8Encoder:

Public Member Functions

 Utf8Encoder (FromType sourceEncoding)
 
std::string getUtf8 (const char *input, size_t size)
 
std::string getUtf8 (const std::string &str)
 
std::string getLegacyEnc (const char *input, size_t size)
 
std::string getLegacyEnc (const std::string &str)
 

Private Member Functions

void resize (size_t size)
 
size_t getLength (const char *input, bool &ascii)
 
void copyFromArray (unsigned char chp, char *&out)
 
size_t getLength2 (const char *input, bool &ascii)
 
void copyFromArray2 (const char *&chp, char *&out)
 

Private Attributes

std::vector< char > mOutput
 
signed char * translationArray
 

Constructor & Destructor Documentation

Utf8Encoder::Utf8Encoder ( FromType  sourceEncoding)

Member Function Documentation

void Utf8Encoder::copyFromArray ( unsigned char  chp,
char *&  out 
)
private

Here is the caller graph for this function:

void Utf8Encoder::copyFromArray2 ( const char *&  chp,
char *&  out 
)
private

Here is the caller graph for this function:

std::string Utf8Encoder::getLegacyEnc ( const char *  input,
size_t  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string ToUTF8::Utf8Encoder::getLegacyEnc ( const std::string &  str)
inline

Here is the call graph for this function:

size_t Utf8Encoder::getLength ( const char *  input,
bool ascii 
)
private

Get the total length length needed to decode the given string with the given translation array. The arrays are encoded with 6 bytes per character, with the first giving the length and the next 5 the actual data.

The function serves a dual purpose for optimization reasons: it checks if the input is pure ascii (all values are <= 127). If this is the case, then the ascii parameter is set to true, and the caller can optimize for this case.

Here is the caller graph for this function:

size_t Utf8Encoder::getLength2 ( const char *  input,
bool ascii 
)
private

Here is the caller graph for this function:

std::string Utf8Encoder::getUtf8 ( const char *  input,
size_t  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string ToUTF8::Utf8Encoder::getUtf8 ( const std::string &  str)
inline

Here is the call graph for this function:

void Utf8Encoder::resize ( size_t  size)
private

Here is the caller graph for this function:

Member Data Documentation

std::vector<char> ToUTF8::Utf8Encoder::mOutput
private
signed char* ToUTF8::Utf8Encoder::translationArray
private

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