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: canEncode, data, getBitSize, index, value
Creates an illegal RestrictedAlphabet. Used for reserved alphabets 3-15.
RestrictedAlphabet(
const std::string & data
);
Creates the RestrictedAlphabet using the given data.
Destroys the RestrictedAlphabet.
bool canEncode(
const std::string & data
);
Tests if we can encode a certain string with the given alphabet.
const std::string & data() const;
Returns the alphabet's data.
int getBitSize() const;
Returns the number of bits required to encode a single character
Poco::UInt32 index(
const char & value
) const;
Converts a value to its index, returns string::npos if not found.
const char & value(
Poco::UInt32 idx
) const;
Converts a integer vaue to the character it presents.