IWriter Class Referenceabstract

EBML formating class. More...

Inherited by CWriter, and CWriter.

Public Member Functions

virtual EBML::boolean openChild (const EBML::CIdentifier &rIdentifier)=0
 Starts a new child node. More...
 
virtual EBML::boolean setChildData (const void *pBuffer, const EBML::uint64 ui64BufferSize)=0
 Sets data for simple child node. More...
 
virtual EBML::boolean closeChild (void)=0
 Closes currently opened child node. More...
 
virtual void release (void)=0
 Tells this object it won't be used anymore. More...
 

Protected Member Functions

virtual ~IWriter (void)
 Virtual destructor - should be overloaded.
 

Detailed Description

EBML formating class.

Author
Yann Renard (INRIA/IRISA)
Date
2006-08-07 This class is used in order to format datas using EBML specifications. It gives a minimalistic interface to allow creating new EBML nodes, and to insert data in simple child nodes.

Basic usage of this class consists in :

  • Create child node
  • Gives information about the node :
    • Whether created node is master node (Goto 1)
    • Whether created node is simple child node (set data for this child node)
  • Close opened node

The EBML::IWriterHelper class could be used in order to send EBML standard data such as integers, floats, strings, etc...

To create instances of this class, the user has to call EBML::createWriter. To delete instances of this class, the user has to call EBML::IWriter::release.

Be sure to look at http://ebml.sourceforge.net/specs/ in order to understand what EBML is and how it should be used.

Member Function Documentation

virtual EBML::boolean openChild ( const EBML::CIdentifier rIdentifier)
pure virtual

Starts a new child node.

Parameters
rIdentifier[in] : The identifier of the new child node
Returns
true on success.
false on error.

This function is called when the user wants to add a child node to the currently opened master node. A node containing data can not have child so if setChildData has been called before, this function returns false.

Once the node has been opened, it should be closed calling closeChild.

virtual EBML::boolean setChildData ( const void *  pBuffer,
const EBML::uint64  ui64BufferSize 
)
pure virtual

Sets data for simple child node.

Parameters
pBuffer[in] : The buffer to set as child data
ui64BufferSize[in] : The buffer size in bytes
Returns
true on success.
false on error.

This function is called by the user for setting data in the currently opened simple child node. If the currently opened node has children, it is a master node so it can't receive data. In such case, the function returns false. However, it the currently opened node already has data, it returns false too.

virtual EBML::boolean closeChild ( void  )
pure virtual

Closes currently opened child node.

Returns
true on success.
false on error.

This function is called when the user wants to close a child node. The node should have received either child nodes or data depending if it is a master node or a simple child node.

virtual void release ( void  )
pure virtual

Tells this object it won't be used anymore.

Instances of this class can not be instanciated another way than calling createWriter. They can not be deleted either because the destructor is. protected. The library knows how to create and delete an instance of this class... Calling release will simply delete this instance and handle necessary cleanings when needed.

The current object is invalid after calling this function. It can not be used anymore.