SNAP Library 6.0, User Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <unicode.h>
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 |
class | TUnicode |
|
protected |
anonymous enum |
|
protected |
Enumerator | |
---|---|
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte | |
DefineByte |
Definition at line 101 of file unicode.h.
|
protected |
Enumerator | |
---|---|
Utf16FirstSurrogate | |
Utf16SecondSurrogate |
Definition at line 157 of file unicode.h.
|
inline |
Definition at line 91 of file unicode.h.
|
inline |
Definition at line 95 of file unicode.h.
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 |
Definition at line 2210 of file unicode.h.
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 |
Definition at line 2294 of file unicode.h.
size_t TUniCodec::DecodeUtf8 | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const |
Definition at line 2036 of file unicode.h.
|
inline |
Definition at line 136 of file unicode.h.
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 |
Definition at line 2428 of file unicode.h.
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 |
Definition at line 2376 of file unicode.h.
size_t TUniCodec::EncodeUtf8 | ( | const TSrcVec & | src, |
size_t | srcIdx, | ||
const size_t | srcCount, | ||
TVec< TDestCh > & | dest, | ||
const bool | clrDest = true |
||
) | const |
Definition at line 2152 of file unicode.h.
|
inline |
Definition at line 145 of file unicode.h.
|
inline |
Definition at line 149 of file unicode.h.
|
inline |
Definition at line 150 of file unicode.h.
Definition at line 62 of file unicode.cpp.
Definition at line 71 of file unicode.cpp.
|
staticprotected |
Definition at line 83 of file unicode.cpp.
|
inlinestaticprotected |
|
protected |
Definition at line 341 of file unicode.cpp.
Definition at line 133 of file unicode.cpp.
|
protected |
Definition at line 284 of file unicode.cpp.
void TUniCodec::TestUtf16 | ( | ) |
Definition at line 408 of file unicode.cpp.
|
protected |
Definition at line 99 of file unicode.cpp.
void TUniCodec::TestUtf8 | ( | ) |
Definition at line 194 of file unicode.cpp.
Definition at line 274 of file unicode.cpp.
|
friend |
TUnicodeErrorHandling TUniCodec::errorHandling |