Poco::FastInfoset

class RestrictedAlphabet

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: canEncode, data, getBitSize, index, value

Constructors

RestrictedAlphabet

RestrictedAlphabet();

Creates an illegal RestrictedAlphabet. Used for reserved alphabets 3-15

RestrictedAlphabet

RestrictedAlphabet(
    const Poco::XML::XMLString & data
);

Creates the RestrictedAlphabet.

Destructor

~RestrictedAlphabet

~RestrictedAlphabet();

Destroys the RestrictedAlphabet.

Member Functions

canEncode

bool canEncode(
    const Poco::XML::XMLString & data
);

Tests if we can encode a certain string with the given alphabet

data inline

const Poco::XML::XMLString & data() const;

getBitSize inline

int getBitSize() const;

Returns the number of bits required to encode a single character

index inline

Poco::UInt32 index(
    const Poco::XML::XMLChar & value
) const;

Converts a value to its index, returns string::npos if not found.

value inline

const Poco::XML::XMLChar & value(
    Poco::UInt32 idx
) const;

Converts a integer vaue to the character it presents.