Poco::FastInfoset

class Converter

File Information

Library: FastInfoset
Package: FastInfoset
Header: Poco/FastInfoset/Converter.h

Description

The Converter class provides convenience methods for converting from Fast Infoset to XML and vice versa.

Member Summary

Member Functions: convertToFIS, convertToXML

Enumerations

ConversionOptions

CONV_WRITE_XML_DECLARATION = 0x01

Write an XML declaration at the beginning of the resulting XML document.

CONV_PRETTY_PRINT_XML = 0x02

Pretty-print (indent) the resulting XML document.

CONV_REMOVE_IGNORABLE_WHITESPACE = 0x81

Remove all whitespace-only character content between elements.

Member Functions

convertToFIS static

static void convertToFIS(
    std::istream & xmlInput,
    std::ostream & fisOutput,
    int maxIndexedStringLength = 16,
    int options = 0
);

Converts an XML input stream into a FIS output stream, throws an exception if an error occurs while parsing the XML or writing the FIS document.

maxIndexedStringLength specifies the maximum length of strings entered into the vocabulary. Specifying a higher value results in potentially smaller FIS documents at the expense of higher memory usage during conversion.

The CONV_REMOVE_IGNORABLE_WHITESPACE option can be specified to remove all whitespace-only character content between elements.

convertToXML static

static void convertToXML(
    std::istream & fisInput,
    std::ostream & xmlOutput,
    int options = 0
);

Converts an FIS input stream into a XML output stream, throws an exception if an error occurs while parsing the FIS or writing the XML document.

The CONV_PRETTY_PRINT_XML option can be specified to pretty-print the resulting XML document. The CONV_WRITE_XML_DECLARATION can be specified to write an XML declaration at the beginning of the resulting XML document.

Securely control IoT edge devices from anywhere   Connect a Device