Poco::FastInfoset

class RestrictedAlphabet

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

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

~RestrictedAlphabet();

Destroys the RestrictedAlphabet.

Member Functions

bitSize inline

int bitSize() const;

Returns the number of bits required to encode a single character.

charToIndex inline

int charToIndex(
    int ch
) const;

Converts a Unicode character to its index, returns -1 if not found.

characters inline

const std::string & characters() const;

Returns a UTF-8 string containing all characters of the alphabet.

indexToChar inline

int indexToChar(
    int index
) const;

Converts a character index to the character it represents.

isEndOfString inline

bool isEndOfString(
    int index
) const;

Returns true iff the given character index marks the end of the encoded string.

Securely control IoT edge devices from anywhere   Connect a Device