Poco::FastInfoset

class Encoding

File Information

Library: FastInfoset
Package: CodingAlgorithm
Header: Poco/FastInfoset/Encoding.h

Description

The base class for all encoding algorithms.

An encoding algorithm is responsible for writing data in encoded form to a FIS document, and for reading encoded data from a FIS document.

It also provides facilities for converting encoded data into text and vice versa.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Known Derived Classes: IntEncoding, UUIDEncoding, HexEncoding, CDataEncoding, DoubleEncoding, LongEncoding, NullEncoding, FloatEncoding, NullRefEncoding, ShortEncoding, BoolEncoding, DWordEncoding

Member Summary

Member Functions: checkMethod, content, createContent, decodeMethod, encodeMethod, handle, merge, type, write

Inherited Functions: duplicate, referenceCount, release

Types

CheckMethod

typedef Poco::Int32 (* CheckMethod)(const std::string &);

Test if the encoding can encode the given string. If yes, returns the size of the encoded data, otherwise a value < 0.

DecodeMethod

typedef Encoding::Ptr (* DecodeMethod)(BitStreamReader & reader);

Decodes data from the reader into the returned Encoding object for which it is guaranteed that createContent was called.

EncodeMethod

typedef void (* EncodeMethod)(BitStreamWriter &, const std::string &);

Encode the given in the string and write the encoded data using the writer.

Ptr

typedef Poco::AutoPtr < Encoding > Ptr;

Constructors

Encoding

Encoding();

Creates the Encoding.

Encoding

explicit Encoding(
    const std::string & content
);

Creates the Encoding using the given content.

Encoding

Encoding(
    const char * data,
    std::size_t length
);

Creates the Encoding using the given content.

Destructor

~Encoding virtual

virtual ~Encoding();

Destroys the Encoding.

Member Functions

checkMethod virtual

virtual CheckMethod checkMethod() const = 0;

Returns the check method.

content virtual inline

virtual const std::string & content() const;

Returns the content as string.

content virtual

virtual std::string & content();

Returns the content as string.

createContent virtual

virtual void createContent() = 0;

Creates the string content from the encoded data. Must be called before calling content().

decodeMethod virtual

virtual DecodeMethod decodeMethod() const = 0;

Returns the decode method.

encodeMethod virtual

virtual EncodeMethod encodeMethod() const = 0;

Returns the encode method.

handle virtual inline

virtual void handle(
    Poco::XML::ContentHandler * pHandler
) const;

Pass the decoded data to the given ContentHandler.

handle virtual

virtual void handle(
    FISContentHandler * pHandler
) const = 0;

Pass the decoded data to the given FISContentHandler.

merge virtual

virtual bool merge(
    const Encoding & enc
) = 0;

Merges the given encoding into the current one if and only if the two encoding types are identical.

type virtual

virtual Poco::UInt32 type() const = 0;

Returns the encoding type.

write virtual

virtual void write(
    BitStreamWriter & writer
) const = 0;

Writes the internally stored data to the writer.

Variables

_content protected

std::string _content;

Securely control IoT edge devices from anywhere   Connect a Device