Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

XmlCodec Class Reference

A XML encoding/decoding class. More...

#include <xmlcodec.h>

Inheritance diagram for XmlCodec:

XmlCodecBase UserOfTextCodec List of all members.

Public Methods

 XmlCodec (void)
 A constructor. More...

virtual ~XmlCodec (void)
 A destructor. More...

virtual bool encode (IODevice *inDevice, IODevice *outDevice)
 Encode data from one device to another (the PULL mode). More...

virtual void initializePushCoder (IODevice *outDevice)
 Initialize the coder in PUSH mode. More...

virtual bool encodePush (const char *data, int length, bool isFinal=false)
 Encode the data in PUSH mode. More...

virtual bool decode (IODevice *inDevice, SAXReceptor *receptor, void *userData=0)
 Decode data from one device and use given SAX receptor. More...


Protected Attributes

IODeviceinputDevice
 The input device.

IODeviceoutputDevice
 The output device.

XmlParserxmlParser
 The XML parser.

XmlModelBasexmlModel
 The XML model.

KYGrammarkyGrammar
 The KY grammar.

Contextcontext
 The arithmetic coding context.

ArithCodecarithCodec
 The arithmetic coder/decoder.


Detailed Description

A XML encoding/decoding class.

This class implements the XML data encoding and decoding operations.

Definition at line 53 of file xmlcodec.h.


Constructor & Destructor Documentation

XmlCodec::XmlCodec void   
 

A constructor.

Does nothing special.

Definition at line 61 of file xmlcodec.cpp.

XmlCodec::~XmlCodec void    [virtual]
 

A destructor.

Deletes the default text codec (if any).

Definition at line 71 of file xmlcodec.cpp.

References UserOfTextCodec::deleteDefaultTextCodec.


Member Function Documentation

bool XmlCodec::decode IODevice   inDevice,
SAXReceptor   receptor,
void *    userData = 0
[virtual]
 

Decode data from one device and use given SAX receptor.

The codec creates all of the necessary underlying components and decodes the data. The codec sends SAX events to the SAX receptor.

Parameters:
inDevice  The input device.
receptor  The SAX event receptor.
userData  The user data structure.

Implements XmlCodecBase.

Definition at line 335 of file xmlcodec.cpp.

References KYGrammar::appendToRootRule, arithCodec, B_BITS, CHECK_POINTER, context, Context::decode, Fibonacci::decode, DELETE, DISPLAY_DECOMPRESSION_SUMMARY, ArithCodec::doneInputtingBits, DynamicContext, ContextBase::endOfMessage, IODevice::eof, ERR, IODevice::errorOccurred, F_BITS, FATAL, FILE_STAMP, KYGrammar::findRule, ArithCodec::finishDecode, IODevice::getChar, ExaltOptions::getOption, Context::initialize, inputDevice, kyGrammar, NEW, ContextBase::NotKnown, FunnelDevice::prepare, IODevice::readData, Rule::refCount, RuleElement::rule, ContextBase::setArithCodec, KYGrammar::setContext, ArithCodecBase::setInputDevice, KYGrammar::setOutputDevice, XmlModelBase::setSAXEmitter, UserOfTextCodec::setTextCodec, Context::setType, ArithCodec::startDecode, ArithCodec::startInputtingBits, Terminal, UserOfTextCodec::textCodec, RuleElement::type, RuleElement::value, Variable, ExaltOptions::Verbose, xmlModel, and ExaltOptions::Yes.

Referenced by ExaltCodec::decode.

bool XmlCodec::encode IODevice   inDevice,
IODevice   outDevice
[virtual]
 

Encode data from one device to another (the PULL mode).

The codec creates all of the necessary underlying components and encodes the data.

Parameters:
inDevice  The input device.
outDevice  The output device.

Implements XmlCodecBase.

Definition at line 223 of file xmlcodec.cpp.

References arithCodec, B_BITS, XmlCodecBase::coderType, context, DELETE, DISPLAY_COMPRESSION_SUMMARY, ArithCodec::doneOutputtingBits, Context::encodeEndOfMessage, F_BITS, FILE_STAMP, ArithCodec::finishEncode, ExaltOptions::getOption, inputDevice, kyGrammar, ExaltOptions::Model, NEW, outputDevice, XmlParser::parse, PullCoder, IODevice::putChar, ContextBase::setArithCodec, KYGrammar::setContext, XmlModelBase::setGrammar, XmlParserBase::setInputDevice, ArithCodecBase::setOutputDevice, KYGrammar::setOutputDevice, UserOfTextCodec::setTextCodec, XmlParserBase::setXmlModel, ExaltOptions::SimpleModel, ArithCodec::startEncode, ArithCodec::startOutputtingBits, UserOfTextCodec::textCodec, ExaltOptions::Verbose, IODevice::writeData, xmlModel, xmlParser, and ExaltOptions::Yes.

bool XmlCodec::encodePush const char *    data,
int    length,
bool    isFinal = false
[virtual]
 

Encode the data in PUSH mode.

The coder encodes given chunk of data.

Parameters:
data  The chunk of XML data.
length  The length of the data.
isFinal  Indication whether the coder received the last chunk of data.

Implements XmlCodecBase.

Definition at line 163 of file xmlcodec.cpp.

References arithCodec, XmlCodecBase::coderType, context, DELETE, DISPLAY_COMPRESSION_SUMMARY, ArithCodec::doneOutputtingBits, Context::encodeEndOfMessage, ArithCodec::finishEncode, ExaltOptions::getOption, kyGrammar, XmlParser::parsePush, PullCoder, UnknownCoder, ExaltOptions::Verbose, xmlModel, xmlParser, and ExaltOptions::Yes.

void XmlCodec::initializePushCoder IODevice   outDevice [virtual]
 

Initialize the coder in PUSH mode.

Initializes the codec in PUSH mode.

Parameters:
outDevice  The output device used for output of compressed data.

Implements XmlCodecBase.

Definition at line 82 of file xmlcodec.cpp.

References arithCodec, B_BITS, XmlCodecBase::coderType, context, F_BITS, FILE_STAMP, ExaltOptions::getOption, inputDevice, kyGrammar, ExaltOptions::Model, NEW, outputDevice, PullCoder, PushCoder, IODevice::putChar, ContextBase::setArithCodec, KYGrammar::setContext, XmlModelBase::setGrammar, ArithCodecBase::setOutputDevice, KYGrammar::setOutputDevice, UserOfTextCodec::setTextCodec, XmlParserBase::setXmlModel, ExaltOptions::SimpleModel, ArithCodec::startEncode, ArithCodec::startOutputtingBits, UserOfTextCodec::textCodec, UnknownCoder, IODevice::writeData, xmlModel, and xmlParser.


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 10:43:06 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002