decompiler 1.0.0
Public Member Functions | Private Attributes | Friends | List of all members
XmlEncode Class Reference

An XML based encoder. More...

#include <marshal.hh>

Inheritance diagram for XmlEncode:
Encoder

Public Member Functions

 XmlEncode (ostream &s)
 Construct from a stream.
 
virtual void openElement (const ElementId &elemId)
 Begin a new element in the encoding. More...
 
virtual void closeElement (const ElementId &elemId)
 End the current element in the encoding. More...
 
virtual void writeBool (const AttributeId &attribId, bool val)
 Write an annotated boolean value into the encoding. More...
 
virtual void writeSignedInteger (const AttributeId &attribId, intb val)
 Write an annotated signed integer value into the encoding. More...
 
virtual void writeUnsignedInteger (const AttributeId &attribId, uintb val)
 Write an annotated unsigned integer value into the encoding. More...
 
virtual void writeString (const AttributeId &attribId, const string &val)
 Write an annotated string into the encoding. More...
 
virtual void writeSpace (const AttributeId &attribId, const AddrSpace *spc)
 Write an address space reference into the encoding. More...
 
- Public Member Functions inherited from Encoder
virtual ~Encoder (void)
 Destructor.
 
virtual void openElement (const ElementId &elemId)=0
 Begin a new element in the encoding. More...
 
virtual void closeElement (const ElementId &elemId)=0
 End the current element in the encoding. More...
 
virtual void writeBool (const AttributeId &attribId, bool val)=0
 Write an annotated boolean value into the encoding. More...
 
virtual void writeSignedInteger (const AttributeId &attribId, intb val)=0
 Write an annotated signed integer value into the encoding. More...
 
virtual void writeUnsignedInteger (const AttributeId &attribId, uintb val)=0
 Write an annotated unsigned integer value into the encoding. More...
 
virtual void writeString (const AttributeId &attribId, const string &val)=0
 Write an annotated string into the encoding. More...
 
virtual void writeSpace (const AttributeId &attribId, const AddrSpace *spc)=0
 Write an address space reference into the encoding. More...
 

Private Attributes

ostream & outStream
 The stream receiving the encoded data.
 
bool elementTagIsOpen
 If true, new attributes can be written to the current element.
 

Friends

class XmlDecode
 

Detailed Description

An XML based encoder.

The underlying transfer encoding is an XML document. The encoder is initialized with a stream which will receive the XML document as calls are made on the encoder.

Member Function Documentation

◆ closeElement()

void XmlEncode::closeElement ( const ElementId elemId)
virtual

End the current element in the encoding.

The current element must match the given annotation or an exception is thrown.

Parameters
elemIdis the given (expected) annotation for the current element

Implements Encoder.

◆ openElement()

void XmlEncode::openElement ( const ElementId elemId)
virtual

Begin a new element in the encoding.

The element will have the given ElementId annotation and becomes the current element.

Parameters
elemIdis the given ElementId annotation

Implements Encoder.

References elementTagIsOpen.

◆ writeBool()

void XmlEncode::writeBool ( const AttributeId attribId,
bool  val 
)
virtual

Write an annotated boolean value into the encoding.

The boolean data is associated with the given AttributeId annotation and the current open element.

Parameters
attribIdis the given AttributeId annotation
valis boolean value to encode

Implements Encoder.

◆ writeSignedInteger()

void XmlEncode::writeSignedInteger ( const AttributeId attribId,
intb  val 
)
virtual

Write an annotated signed integer value into the encoding.

The integer is associated with the given AttributeId annotation and the current open element.

Parameters
attribIdis the given AttributeId annotation
valis the signed integer value to encode

Implements Encoder.

◆ writeSpace()

void XmlEncode::writeSpace ( const AttributeId attribId,
const AddrSpace spc 
)
virtual

Write an address space reference into the encoding.

The address space is associated with the given AttributeId annotation and the current open element.

Parameters
attribIdis the given AttributeId annotation
spcis the address space to encode

Implements Encoder.

◆ writeString()

void XmlEncode::writeString ( const AttributeId attribId,
const string &  val 
)
virtual

Write an annotated string into the encoding.

The string is associated with the given AttributeId annotation and the current open element.

Parameters
attribIdis the given AttributeId annotation
valis the string to encode

Implements Encoder.

◆ writeUnsignedInteger()

void XmlEncode::writeUnsignedInteger ( const AttributeId attribId,
uintb  val 
)
virtual

Write an annotated unsigned integer value into the encoding.

The integer is associated with the given AttributeId annotation and the current open element.

Parameters
attribIdis the given AttributeId annotation
valis the unsigned integer value to encode

Implements Encoder.


The documentation for this class was generated from the following files: