Actin  Version 5.5.5
Software for Robotics Simulation and Control
EcXmlObjectReaderWriter Class Reference

Helper class to support reading and writing of an EcXmlObject using several methods. More...

#include <ecXmlObjectReaderWriter.h>

Public Types

enum  MediaTypeEnum {
  LocalFile = 1,
  Url = 2,
  StdStream = 3,
  Buffer = 4,
  Socket = 5,
  Compressed = 0xe0
}
 The media description and attributes that can be added to the media type. More...
 
typedef EcU16 MediaType
 Type to hold media description.
 

Static Public Member Functions

template<typename T >
static EcBoolean read (EcXmlObject &obj, T &where, const MediaType type)
 
template<typename T >
static EcBoolean write (const EcXmlObject &obj, const T &where, const MediaType type)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL registerSupportedInputStreams (EcXmlReader &reader)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL isGzip (const EcString &filename)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromStream (EcXmlObject &obj, std::istream &stream, const EcString &streamName, const EcToken &token=EcXml::EcNullToken, EcInt64 streamSize=-1, EcInt32 *pProgress=EcNULL, EcBoolean stopOnParseError=EcFalse)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToStream (const EcXmlObject &obj, std::ostream &stream, const EcString &streamName, const EcToken &token=EcXml::EcNullToken)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromFileAbsoluteLocation (EcXmlObject &obj, const EcString &fileName, const EcToken &token=EcXml::EcNullToken, EcInt32 *pProgress=EcNULL)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromFile (EcXmlObject &obj, const EcString &fileName, const EcToken &token=EcXml::EcNullToken, EcInt32 *pProgress=EcNULL, EcBoolean stopOnParseError=EcFalse)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToFile (const EcXmlObject &obj, const EcString &fileName, const EcToken &token=EcXml::EcNullToken)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToFile (const EcXmlObject &obj, const EcString &fileName, const EcString &version, const EcToken &token=EcXml::EcNullToken)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToGeneralFile (const EcXmlObject &obj, const EcString &filename, const EcBoolean gzipFlag, const EcToken &token)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToGeneralFile (const EcXmlObject &obj, const EcString &filename, const EcBoolean gzipFlag, const EcString &version, const EcToken &token)
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromUrl (EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 read this object from URL
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromBuffer (EcXmlObject &obj, const EcString &buffer, const EcToken &token=EcXml::EcNullToken, EcBoolean stopOnParseError=EcFalse)
 read this object from a buffer
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToBuffer (const EcXmlObject &obj, EcString &buffer, const EcToken &token=EcXml::EcNullToken)
 write this object to a buffer
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromCompressedBuffer (EcXmlObject &obj, const EcString &buffer, const EcToken &token=EcXml::EcNullToken)
 read this object from a compressed buffer
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToCompressedBuffer (const EcXmlObject &obj, EcString &buffer, const EcToken &token=EcXml::EcNullToken)
 write this object to a compressed buffer
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL readFromTcpSocket (EcXmlObject &obj, const EcTcpSocket *clientSocket, const EcToken &token=EcXml::EcNullToken)
 read this object from TCP socket
 
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL writeToTcpSocket (const EcXmlObject &obj, const EcTcpSocket *clientSocket, const EcInt32 headerID=0, const EcToken &token=EcXml::EcNullToken)
 write this object to TCP socket
 

Static Protected Member Functions

static EcBoolean readFromFilePlain (EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken, EcInt32 *pProgress=EcNULL, EcBoolean stopOnParseError=EcFalse)
 read this object from an uncompressed file
 
static EcBoolean writeToFilePlain (const EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 write this object to an uncompressed file
 
static EcBoolean writeToFilePlain (const EcXmlObject &obj, const EcString &filename, const EcString &version, const EcToken &token=EcXml::EcNullToken)
 write this object to an uncompressed file
 
static EcBoolean writeToFilePlainWithSchema (const EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 write this object to an uncompressed file
 
static EcBoolean writeToFilePlainWithSchema (const EcXmlObject &obj, const EcString &filename, const EcString &version, const EcToken &token=EcXml::EcNullToken)
 write this object to an uncompressed file
 
static EcBoolean readFromFileWithCompression (EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken, EcInt32 *pProgress=EcNULL)
 read this object from a compressed file
 
static EcBoolean writeToFileWithCompression (const EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 write this object to a compressed file
 
static EcBoolean readFromFileWithCompression2 (EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 read this object from a compressed file using filteringStreams
 
static EcBoolean writeToFileWithCompression2 (const EcXmlObject &obj, const EcString &filename, const EcToken &token=EcXml::EcNullToken)
 write this object to a compressed file
 

Detailed Description

Helper class to support reading and writing of an EcXmlObject using several methods.

Definition at line 23 of file ecXmlObjectReaderWriter.h.

Member Enumeration Documentation

The media description and attributes that can be added to the media type.

Enumerator
LocalFile 

Flat file.

Url 

web url

StdStream 

std::stream

Buffer 

EcString.

Socket 

TCP socket.

Compressed 

Compressed data.

Definition at line 28 of file ecXmlObjectReaderWriter.h.

Member Function Documentation

static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::isGzip ( const EcString filename)
static

test filename for Gzip status

Parameters
filenameInput file name
Returns
EcBoolean Success or failure of command.
template<typename T >
static EcBoolean EcXmlObjectReaderWriter::read ( EcXmlObject obj,
T &  where,
const MediaType  type 
)
static

Read object in from a generic type. it just calls obj.read(stream)

Parameters
objObject to read into.
whereLocation to read from.
typeLocation type.
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::readFromFile ( EcXmlObject obj,
const EcString fileName,
const EcToken token = EcXml::EcNullToken,
EcInt32 pProgress = EcNULL,
EcBoolean  stopOnParseError = EcFalse 
)
static

Read object in from a local file.

Parameters
objObject to read into.
fileNameFile to read from.
tokenOptional object type
Returns
EcBoolean Success or failure of command.
Examples:
controlExecutiveModifierExampleMain.cpp, and ecPathPlanningCoreMain.cpp.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::readFromFileAbsoluteLocation ( EcXmlObject obj,
const EcString fileName,
const EcToken token = EcXml::EcNullToken,
EcInt32 pProgress = EcNULL 
)
static

Read object in from a local file using only the directory location specified.

Parameters
objObject to read into.
fileNameFile to read from.
tokenOptional object type
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::readFromStream ( EcXmlObject obj,
std::istream &  stream,
const EcString streamName,
const EcToken token = EcXml::EcNullToken,
EcInt64  streamSize = -1,
EcInt32 pProgress = EcNULL,
EcBoolean  stopOnParseError = EcFalse 
)
static

Read object in from a std::istream.

Parameters
objObject to read into.
streamStream to read from.
streamNameStream filename.
tokenOptional object type
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::registerSupportedInputStreams ( EcXmlReader reader)
static

Register supported input streams to the XML Reader

Parameters
readerthe XML Reader
Returns
True if successful
template<typename T >
static EcBoolean EcXmlObjectReaderWriter::write ( const EcXmlObject obj,
const T &  where,
const MediaType  type 
)
static

Write object out to a generic type. it just calls obj.write(stream)

Parameters
objObject to write out.
whereLocation to write to.
typeLocation type.
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::writeToFile ( const EcXmlObject obj,
const EcString fileName,
const EcToken token = EcXml::EcNullToken 
)
static

Write object out to a local file.

Parameters
objObject to write out.
fileNameFile to write to.
tokenBase tag token to write out
Returns
EcBoolean Success or failure of command.
Examples:
ecCollisionAvoidanceExample.cpp, and ecProgrammaticConstructionMain.cpp.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::writeToFile ( const EcXmlObject obj,
const EcString fileName,
const EcString version,
const EcToken token = EcXml::EcNullToken 
)
static

Write object out to a local file.

Parameters
objObject to write out.
fileNameFile to write to.
versionMinimum compatible Actin version.
tokenBase tag token to write out
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::writeToGeneralFile ( const EcXmlObject obj,
const EcString filename,
const EcBoolean  gzipFlag,
const EcToken token 
)
static

Write object out to a local file.

Parameters
objObject to write out.
filenameFile to write to.
gzipFlaggzip flag
tokenBase tag token to write out
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::writeToGeneralFile ( const EcXmlObject obj,
const EcString filename,
const EcBoolean  gzipFlag,
const EcString version,
const EcToken token 
)
static

Write object out to a local file.

Parameters
objObject to write out.
filenameFile to write to.
gzipFlaggzip flag
versionMinimum compatible Actin version.
tokenBase tag token to write out
Returns
EcBoolean Success or failure of command.
static EcBoolean EC_STABLE_XMLREADERWRITER_DECL EcXmlObjectReaderWriter::writeToStream ( const EcXmlObject obj,
std::ostream &  stream,
const EcString streamName,
const EcToken token = EcXml::EcNullToken 
)
static

Write object out to a std::ostream.

Parameters
objObject to write out
streamStream to write to
streamNameStream filename
tokenBase tag token to write out
Returns
EcBoolean Success or failure of command

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