File Information
Library: FastInfoset
Package: FastInfoset
Header: Poco/FastInfoset/RestrictedAlphabet.h
Description
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 Summary
Member Functions: bitSize, charToIndex, characters, indexToChar, isEndOfString
Constructors
RestrictedAlphabet
Creates an illegal RestrictedAlphabet. Used for reserved alphabets 3-15.
RestrictedAlphabet
RestrictedAlphabet(
const std::string & utf8Characters
);
Creates the RestrictedAlphabet using the given table, which is a sequence of UTF-8 encoded characters.
Destructor
~RestrictedAlphabet
Destroys the RestrictedAlphabet.
Member Functions
bitSize
int bitSize() const;
Returns the number of bits required to encode a single character.
charToIndex
int charToIndex(
int ch
) const;
Converts a Unicode character to its index, returns -1 if not found.
characters
const std::string & characters() const;
Returns a UTF-8 string containing all characters of the alphabet.
indexToChar
int indexToChar(
int index
) const;
Converts a character index to the character it represents.
isEndOfString
bool isEndOfString(
int index
) const;
Returns true iff the given character index marks the end of the encoded string.