SNAP Library, User Reference
2012-10-02 12:56:23
SNAP, a general purpose network analysis and graph mining library
|
Public Types | |
enum | { DefaultReplacementChar = 0xfffd } |
Public Member Functions | |
TUniCodec () | |
TUniCodec (TUnicodeErrorHandling errorHandling_, bool strict_, int replacementChar_, bool skipBom_) | |
template<typename TSrcVec , typename TDestCh > | |
size_t | DecodeUtf8 (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, const bool clrDest=true) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | DecodeUtf8 (const TSrcVec &src, TVec< TDestCh > &dest, const bool clrDest=true) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | EncodeUtf8 (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, const bool clrDest=true) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | EncodeUtf8 (const TSrcVec &src, TVec< TDestCh > &dest, const bool clrDest=true) const |
template<typename TSrcVec > | |
TStr | EncodeUtf8Str (const TSrcVec &src, size_t srcIdx, const size_t srcCount) const |
template<typename TSrcVec > | |
TStr | EncodeUtf8Str (const TSrcVec &src) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | DecodeUtf16FromBytes (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, const bool clrDest, const TUtf16BomHandling bomHandling=bomAllowed, const TUniByteOrder defaultByteOrder=boMachineEndian) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | DecodeUtf16FromWords (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, bool clrDest, const TUtf16BomHandling bomHandling=bomAllowed, const TUniByteOrder defaultByteOrder=boMachineEndian) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | EncodeUtf16ToWords (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, const bool clrDest, const bool insertBom, const TUniByteOrder destByteOrder=boMachineEndian) const |
template<typename TSrcVec , typename TDestCh > | |
size_t | EncodeUtf16ToBytes (const TSrcVec &src, size_t srcIdx, const size_t srcCount, TVec< TDestCh > &dest, const bool clrDest, const bool insertBom, const TUniByteOrder destByteOrder=boMachineEndian) const |
void | TestUtf8 () |
void | TestUtf16 () |
Public Attributes | |
int | replacementChar |
TUnicodeErrorHandling | errorHandling |
bool | strict |
bool | skipBom |
Protected Types | |
enum | { DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0), DefineByte = (1, 0, 0, 0, 0, 0, 0, 0) } |
enum | { Utf16FirstSurrogate = 0xd800, Utf16SecondSurrogate = 0xdc00 } |
typedef TUniVecIdx | TVecIdx |
Protected Member Functions | |
void | TestUtf8 (bool decode, size_t expectedRetVal, bool expectedThrow, const TIntV &src, const TIntV &expectedDest, FILE *f) |
void | TestDecodeUtf8 (TRnd &rnd, const TStr &testCaseDesc) |
void | WordsToBytes (const TIntV &src, TIntV &dest) |
void | TestUtf16 (bool decode, size_t expectedRetVal, bool expectedThrow, const TIntV &src, const TIntV &expectedDest, const TUtf16BomHandling bomHandling, const TUniByteOrder defaultByteOrder, const bool insertBom, FILE *f) |
void | TestDecodeUtf16 (TRnd &rnd, const TStr &testCaseDesc, const TUtf16BomHandling bomHandling, const TUniByteOrder defaultByteOrder, const bool insertBom) |
Static Protected Member Functions | |
static bool | IsMachineLittleEndian () |
static uint | GetRndUint (TRnd &rnd) |
static uint | GetRndUint (TRnd &rnd, uint minVal, uint maxVal) |
static int | SwapBytes (int x) |
Friends | |
class | TUniCaseFolding |
typedef TUniVecIdx TUniCodec::TVecIdx [protected] |
anonymous enum [protected] |
TUniCodec::TUniCodec | ( | ) | [inline] |
TUniCodec::TUniCodec | ( | TUnicodeErrorHandling | errorHandling_, |
bool | strict_, | ||
int | replacementChar_, | ||
bool | skipBom_ | ||
) | [inline] |
size_t TUniCodec::DecodeUtf16FromBytes | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest, | ||
const TUtf16BomHandling | bomHandling = bomAllowed , |
||
const TUniByteOrder | defaultByteOrder = boMachineEndian |
||
) | const |
size_t TUniCodec::DecodeUtf16FromWords | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
bool | clrDest, | ||
const TUtf16BomHandling | bomHandling = bomAllowed , |
||
const TUniByteOrder | defaultByteOrder = boMachineEndian |
||
) | const |
size_t TUniCodec::DecodeUtf8 | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const |
size_t TUniCodec::DecodeUtf8 | ( | const TSrcVec & | src, |
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const [inline] |
size_t TUniCodec::EncodeUtf16ToBytes | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest, | ||
const bool | insertBom, | ||
const TUniByteOrder | destByteOrder = boMachineEndian |
||
) | const |
size_t TUniCodec::EncodeUtf16ToWords | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest, | ||
const bool | insertBom, | ||
const TUniByteOrder | destByteOrder = boMachineEndian |
||
) | const |
size_t TUniCodec::EncodeUtf8 | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const |
size_t TUniCodec::EncodeUtf8 | ( | const TSrcVec & | src, |
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const [inline] |
TStr TUniCodec::EncodeUtf8Str | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount | ||
) | const [inline] |
TStr TUniCodec::EncodeUtf8Str | ( | const TSrcVec & | src | ) | const [inline] |
uint TUniCodec::GetRndUint | ( | TRnd & | rnd | ) | [static, protected] |
uint TUniCodec::GetRndUint | ( | TRnd & | rnd, |
uint | minVal, | ||
uint | maxVal | ||
) | [static, protected] |
bool TUniCodec::IsMachineLittleEndian | ( | ) | [static, protected] |
static int TUniCodec::SwapBytes | ( | int | x | ) | [inline, static, protected] |
void TUniCodec::TestDecodeUtf16 | ( | TRnd & | rnd, |
const TStr & | testCaseDesc, | ||
const TUtf16BomHandling | bomHandling, | ||
const TUniByteOrder | defaultByteOrder, | ||
const bool | insertBom | ||
) | [protected] |
void TUniCodec::TestDecodeUtf8 | ( | TRnd & | rnd, |
const TStr & | testCaseDesc | ||
) | [protected] |
void TUniCodec::TestUtf16 | ( | bool | decode, |
size_t | expectedRetVal, | ||
bool | expectedThrow, | ||
const TIntV & | src, | ||
const TIntV & | expectedDest, | ||
const TUtf16BomHandling | bomHandling, | ||
const TUniByteOrder | defaultByteOrder, | ||
const bool | insertBom, | ||
FILE * | f | ||
) | [protected] |
void TUniCodec::TestUtf16 | ( | ) |
void TUniCodec::TestUtf8 | ( | bool | decode, |
size_t | expectedRetVal, | ||
bool | expectedThrow, | ||
const TIntV & | src, | ||
const TIntV & | expectedDest, | ||
FILE * | f | ||
) | [protected] |
void TUniCodec::TestUtf8 | ( | ) |
void TUniCodec::WordsToBytes | ( | const TIntV & | src, |
TIntV & | dest | ||
) | [protected] |
friend class TUniCaseFolding [friend] |
bool TUniCodec::skipBom |
bool TUniCodec::strict |