- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# StreamSerializer Class Reference

Search for all occurrences

## Detailed Description

Class handling the definition of the format for serialization of data streams.

The adsk::Data::Stream class manages stream definitions. They are persisted using a serialization format implemented through the adsk::Data::StreamSerializer hierarchy. The base class defines the interface and manages the list of available stream serialization formats.

`#include <adskDataStreamSerializer.h>`

List of all members.

## Public Member Functions
| StreamSerializer ()
| Default constructor, does nothing.
virtual | ~StreamSerializer ()
| Default destructor, does nothing.
virtual Stream * | read (std::istream &cSrc, std::string &errors) const =0
| Implement this to parse the serialized form of an adsk::Data::Stream object.
virtual int | write (const Stream &dataToWrite, std::ostream &cDst, std::string &errors) const =0
| Implement this to output the adsk::Data::Stream definition in your serialization format.
virtual void | getFormatDescription (std::ostream &info) const =0
| Implement this to provide a description of your adsk::Data::Stream serialization format.

## Member Function Documentation

Stream * read | ( | std::istream & | cSrc,
|  | std::string & | errors
| ) |  | const`[pure virtual]`

Search for all occurrences

Implement this to parse the serialized form of an adsk::Data::Stream object.

Given an input stream containing your serialization of an adsk::Data::Stream object parse the data and create the adsk::Data::Stream object it describes.

If there are any problems the detailed error information should be returned in the errors string.

The adsk::Data::Stream parsing should also recursively populate any data within the adsk::Data::Stream. This method should be capable of understanding any data which your adsk::Data::StreamSerializer::write method can provide.

Parameters:

  [in] | cSrc | Input stream containing serialization of the adsk::Data::Stream
  [out] | errors | String containing description of parse errors

Returns:
  Pointer to the newly created adsk::Data::Stream object

int write | ( | const Stream & | dataToWrite,
|  | std::ostream & | cDst,
|  | std::string & | errors
| ) |  | const`[pure virtual]`

Search for all occurrences

Implement this to output the adsk::Data::Stream definition in your serialization format.

Given an adsk::Data::Stream object and an output stream as destination write out enough information so that you can recreate the adsk::Data::Stream from data in the output stream using your adsk::Data::StreamSerializer::read() method.

This serialization should include all data values within the adsk::Data::Stream obejct.

Parameters:

  [in] | dataToWrite | adsk::Data::Stream to be serialized
  [out] | cDst | stream to which the object is to be serialized
  [out] | errors | String containing description of write errors

Returns:
  number of errors found during write (0 means success)

void getFormatDescription | ( | std::ostream & | info | ) | const`[pure virtual]`

Search for all occurrences

Implement this to provide a description of your adsk::Data::Stream serialization format.

Output a textual description of your serialization format into the given stream.

Parameters:

  [out] | info | stream in which to output your serialization format description

StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer
StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer StreamSerializer