xoreos  0.0.5
Namespaces | Enumerations | Functions
encoding.h File Reference

Utility functions for working with differing string encodings. More...

#include "src/common/types.h"
Include dependency graph for encoding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Common
 

Enumerations

enum  Common::Encoding {
  Common::kEncodingInvalid = -1, Common::kEncodingASCII, Common::kEncodingUTF8, Common::kEncodingUTF16LE,
  Common::kEncodingUTF16BE, Common::kEncodingLatin9, Common::kEncodingCP1250, Common::kEncodingCP1251,
  Common::kEncodingCP1252, Common::kEncodingCP932, Common::kEncodingCP936, Common::kEncodingCP949,
  Common::kEncodingCP950, Common::kEncodingMAX
}
 

Functions

UString Common::getEncodingName (Encoding encoding)
 Return the human readable name of an encoding. More...
 
bool Common::hasSupportEncoding (Encoding encoding)
 Do we have support for this encoding? More...
 
UString Common::readString (SeekableReadStream &stream, Encoding encoding)
 Read a string with the given encoding of a stream. More...
 
UString Common::readStringFixed (SeekableReadStream &stream, Encoding encoding, size_t length)
 Read length bytes as a string with the given encoding out of a stream. More...
 
UString Common::readStringLine (SeekableReadStream &stream, Encoding encoding)
 Read a line with the given encoding out of a stream. More...
 
UString Common::readString (const byte *data, size_t size, Encoding encoding)
 Read a string with the given encoding from the raw buffer. More...
 
size_t Common::writeString (WriteStream &stream, const Common::UString &str, Encoding encoding, bool terminate=true)
 Write a string into a stream with a given encoding. More...
 
void Common::writeStringFixed (WriteStream &stream, const Common::UString &str, Encoding encoding, size_t length)
 Write a string into a stream with a given encoding and fixed length in bytes. More...
 
MemoryReadStream * Common::convertString (const UString &str, Encoding encoding, bool terminateString=true)
 Convert a string into the given encoding. More...
 
size_t Common::getBytesPerCodepoint (Encoding encoding)
 Return the number of bytes per codepoint in this encoding. More...
 
bool Common::isValidCodepoint (Encoding encoding, uint32 cp)
 Return whether the given codepoint is valid in this encoding. More...
 

Detailed Description

Utility functions for working with differing string encodings.

Definition in file encoding.h.