Class SBCSerializer#
This class is the base class for serializers. More...
#include <SBCSerializer.hpp>
Inherited by the following classes: SBCSerializerBinary, SBCSerializerMemory, SBCSerializerXML
Public Functions#
| Type | Name |
|---|---|
| SBCSerializer () Constructor. |
|
| virtual bool | readBoolElement () Reads an element of boolean type. |
| virtual char * | readCharArrayElement (unsigned int & arraySize) Reads an element of char array type of size arraySize . |
| virtual char | readCharElement () Reads an element of char type. |
| virtual double | readDoubleElement () Reads an element of double type. |
| virtual void | readEndElement () Reads the end element. |
| virtual float | readFloatElement () Reads an element of float type. |
| virtual int | readIntElement () Reads an element of integer type. |
| virtual long | readLongElement () Reads an element of long integer type. |
| virtual long long | readLongLongElement () Reads an element of long long integer type. |
| virtual short | readShortElement () Reads an element of short integer type. |
| virtual void | readStartElement () Reads the start element. |
| virtual std::string | readStringElement () Reads an element of string type. |
| virtual std::string | readStringElementFromBase64 () Reads an element of string type in Base64 (supports html) |
| virtual SBCContainerUUID | readUUIDElement () Reads an element of UUID type. |
| virtual unsigned char | readUnsignedCharElement () Reads an element of unsigned char type. |
| virtual unsigned int | readUnsignedIntElement () Reads an element of unsigned integer type. |
| virtual unsigned long | readUnsignedLongElement () Reads an element of unsigned long integer type. |
| virtual unsigned long long | readUnsignedLongLongElement () Reads an element of unsigned long long integer type. |
| virtual unsigned short | readUnsignedShortElement () Reads an element of unsigned short integer type. |
| virtual void | writeBoolElement (const std::string & elementName, bool element) Writes an element of boolean type with elementName name and valueelement . |
| virtual void | writeCharArrayElement (const std::string & elementName, const char * elementArray, unsigned int arraySize) Writes an element of char array type with elementName name of sizearraySize and valueselementArray . |
| virtual void | writeCharElement (const std::string & elementName, char element) Writes an element of char type with elementName name and valueelement . |
| virtual void | writeDoubleElement (const std::string & elementName, double element) Writes an element of double type with elementName name and valueelement . |
| virtual void | writeEndElement () Writes the end element. |
| virtual void | writeFloatElement (const std::string & elementName, float element) Writes an element of float type with elementName name and valueelement . |
| virtual void | writeIntElement (const std::string & elementName, int element) Writes an element of integer type with elementName name and valueelement . |
| virtual void | writeLongElement (const std::string & elementName, long element) Writes an element of long integer type with elementName name and valueelement . |
| virtual void | writeLongLongElement (const std::string & elementName, long long element) Writes an element of long long integer type with elementName name and valueelement . |
| virtual void | writeShortElement (const std::string & elementName, short element) Writes an element of short integer type with elementName name and valueelement . |
| virtual void | writeStartElement (const std::string & elementName) Writes the start element with elementName name. |
| virtual void | writeStringElement (const std::string & elementName, const std::string & element) Writes an element of string type with elementName name and valueelement . |
| virtual void | writeStringElementInBase64 (const std::string & elementName, const std::string & element) Writes an element of string type in Base64 (supports html) with elementName name and valueelement . |
| virtual void | writeUUIDElement (const std::string & elementName, const SBCContainerUUID & element) Writes an element of UUID type with elementName name and valueelement . |
| virtual void | writeUnsignedCharElement (const std::string & elementName, unsigned char element) Writes an element of unsigned char type with elementName name and valueelement . |
| virtual void | writeUnsignedIntElement (const std::string & elementName, unsigned int element) Writes an element of unsigned integer type with elementName name and valueelement . |
| virtual void | writeUnsignedLongElement (const std::string & elementName, unsigned long element) Writes an element of unsigned long integer type with elementName name and valueelement . |
| virtual void | writeUnsignedLongLongElement (const std::string & elementName, unsigned long long element) Writes an element of unsigned long long integer type with elementName name and valueelement . |
| virtual void | writeUnsignedShortElement (const std::string & elementName, unsigned short element) Writes an element of unsigned short integer type with elementName name and valueelement . |
| virtual | ~SBCSerializer () Destructor. |
Detailed Description#
Short name: SBSerializer
Public Functions Documentation#
function SBCSerializer#
Constructor.
Default constructor.
function readBoolElement#
Reads an element of boolean type.
Reads a boolean element.
Returns:
The value of the boolean element.
function readCharArrayElement#
Reads an element of char array type of size arraySize .
Reads a character array element.
Parameters:
arraySizeReference that receives the size of the returned array.
Returns:
Pointer to a character array containing the element data.
function readCharElement#
Reads an element of char type.
Reads a character element.
Returns:
The value of the character element.
function readDoubleElement#
Reads an element of double type.
Reads a double element.
Returns:
The value of the double element.
function readEndElement#
Reads the end element.
function readFloatElement#
Reads an element of float type.
Reads a float element.
Returns:
The value of the float element.
function readIntElement#
Reads an element of integer type.
Reads an integer element.
Returns:
The value of the integer element.
function readLongElement#
Reads an element of long integer type.
Reads a long integer element.
Returns:
The value of the long integer element.
function readLongLongElement#
Reads an element of long long integer type.
Reads a long long integer element.
Returns:
The value of the long long integer element.
function readShortElement#
Reads an element of short integer type.
Reads a short integer element.
Returns:
The value of the short integer element.
function readStartElement#
Reads the start element.
function readStringElement#
Reads an element of string type.
Reads a string element.
Returns:
The value of the string element.
function readStringElementFromBase64#
Reads an element of string type in Base64 (supports html)
Reads a Base64-encoded string element and decodes it.
Returns:
The decoded string value.
function readUUIDElement#
Reads an element of UUID type.
Reads a UUID element.
Returns:
The value of the UUID element.
function readUnsignedCharElement#
Reads an element of unsigned char type.
Reads an unsigned character element.
Returns:
The value of the unsigned character element.
function readUnsignedIntElement#
Reads an element of unsigned integer type.
Reads an unsigned integer element.
Returns:
The value of the unsigned integer element.
function readUnsignedLongElement#
Reads an element of unsigned long integer type.
Reads an unsigned long integer element.
Returns:
The value of the unsigned long integer element.
function readUnsignedLongLongElement#
Reads an element of unsigned long long integer type.
Reads an unsigned long long integer element.
Returns:
The value of the unsigned long long integer element.
function readUnsignedShortElement#
Reads an element of unsigned short integer type.
Reads an unsigned short integer element.
Returns:
The value of the unsigned short integer element.
function writeBoolElement#
Writes an element of boolean type with elementName name and valueelement .
Writes a boolean element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the boolean element.
function writeCharArrayElement#
Writes an element of char array type with elementName name of sizearraySize and valueselementArray .
virtual void SBCSerializer::writeCharArrayElement (
const std::string & elementName,
const char * elementArray,
unsigned int arraySize
)
Writes a character array element with the given name, data, and size.
Parameters:
elementNameName of the element.elementArrayPointer to the character array data.arraySizeNumber of characters in the array.
function writeCharElement#
Writes an element of char type with elementName name and valueelement .
Writes a character element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the character element.
function writeDoubleElement#
Writes an element of double type with elementName name and valueelement .
Writes a double element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the double element.
function writeEndElement#
Writes the end element.
function writeFloatElement#
Writes an element of float type with elementName name and valueelement .
Writes a float element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the float element.
function writeIntElement#
Writes an element of integer type with elementName name and valueelement .
Writes an integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the integer element.
function writeLongElement#
Writes an element of long integer type with elementName name and valueelement .
Writes a long integer element with the given name and value.
Note: because the size of longs may vary between platforms (e.g. 4 bytes on Windows and 8 bytes on OS X), it is advised not to use this function when portability is required.
Parameters:
elementNameName of the element.elementValue of the long integer element.
function writeLongLongElement#
Writes an element of long long integer type with elementName name and valueelement .
virtual void SBCSerializer::writeLongLongElement (
const std::string & elementName,
long long element
)
Writes a long long integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the long long integer element.
function writeShortElement#
Writes an element of short integer type with elementName name and valueelement .
Writes a short integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the short integer element.
function writeStartElement#
Writes the start element with elementName name.
Writes the start element with the specified name.
Parameters:
elementNameName of the element to start.
function writeStringElement#
Writes an element of string type with elementName name and valueelement .
virtual void SBCSerializer::writeStringElement (
const std::string & elementName,
const std::string & element
)
Writes a string element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the string element.
function writeStringElementInBase64#
Writes an element of string type in Base64 (supports html) with elementName name and valueelement .
virtual void SBCSerializer::writeStringElementInBase64 (
const std::string & elementName,
const std::string & element
)
Writes a string element in Base64 encoding with the given name and value.
Parameters:
elementNameName of the element.elementValue of the string element to be encoded in Base64.
function writeUUIDElement#
Writes an element of UUID type with elementName name and valueelement .
virtual void SBCSerializer::writeUUIDElement (
const std::string & elementName,
const SBCContainerUUID & element
)
Writes a UUID element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the UUID element.
function writeUnsignedCharElement#
Writes an element of unsigned char type with elementName name and valueelement .
virtual void SBCSerializer::writeUnsignedCharElement (
const std::string & elementName,
unsigned char element
)
Writes an unsigned character element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the unsigned character element.
function writeUnsignedIntElement#
Writes an element of unsigned integer type with elementName name and valueelement .
virtual void SBCSerializer::writeUnsignedIntElement (
const std::string & elementName,
unsigned int element
)
Writes an unsigned integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the unsigned integer element.
function writeUnsignedLongElement#
Writes an element of unsigned long integer type with elementName name and valueelement .
virtual void SBCSerializer::writeUnsignedLongElement (
const std::string & elementName,
unsigned long element
)
Writes an unsigned long integer element with the given name and value.
Note: because the size of longs may vary between platforms (e.g. 4 bytes on Windows and 8 bytes on OS X), it is advised not to use this function when portability is required.
Parameters:
elementNameName of the element.elementValue of the unsigned long integer element.
function writeUnsignedLongLongElement#
Writes an element of unsigned long long integer type with elementName name and valueelement .
virtual void SBCSerializer::writeUnsignedLongLongElement (
const std::string & elementName,
unsigned long long element
)
Writes an unsigned long long integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the unsigned long long integer element.
function writeUnsignedShortElement#
Writes an element of unsigned short integer type with elementName name and valueelement .
virtual void SBCSerializer::writeUnsignedShortElement (
const std::string & elementName,
unsigned short element
)
Writes an unsigned short integer element with the given name and value.
Parameters:
elementNameName of the element.elementValue of the unsigned short integer element.
function ~SBCSerializer#
Destructor.
Virtual destructor.