Library: FastInfoset
Package: FastInfoset
Header: Poco/FastInfoset/RestrictedAlphabet.h
A RestrictedAlphabet consists of a sequence of single characters, the position of each character is equal to the integer value used to encode it. Example:
RestrictedAlphabet alph("0123456789"); poco_assert (alph.index('1') == 1); poco_assert (alph.value(1) == '1');
Member Functions: bitSize, charToIndex, characters, indexToChar, isEndOfString
Creates an illegal RestrictedAlphabet. Used for reserved alphabets 3-15.
RestrictedAlphabet(
const std::string & utf8Characters
);
Creates the RestrictedAlphabet using the given table, which is a sequence of UTF-8 encoded characters.
Destroys the RestrictedAlphabet.
int bitSize() const;
Returns the number of bits required to encode a single character.
int charToIndex(
int ch
) const;
Converts a Unicode character to its index, returns -1 if not found.
const std::string & characters() const;
Returns a UTF-8 string containing all characters of the alphabet.
int indexToChar(
int index
) const;
Converts a character index to the character it represents.
bool isEndOfString(
int index
) const;
Returns true if and only if the given character index marks the end of the encoded string.