#include <SaveC.h>
SaveC is used to save the information in Demopaja into a chunk based file format. The data in the output stream is serialized in chunk based format. Each begin_chunk() call should be closed with a call to the end_chunk() method.
This class is implemented by the system.
Example of save() method of an effect class:
uint32
TestEffectC::save( SaveC* pSave )
{
uint32 ui32Error = IO_OK;
// EffectI stuff
pSave->begin_chunk( CHUNK_TESTEFFECT_BASE, TESTEFFECT_VERSION );
ui32Error = EffectI::save( pSave );
pSave->end_chunk();
// Save transform gizmo
pSave->begin_chunk( CHUNK_TESTEFFECT_TRANSGIZMO, TESTEFFECT_VERSION );
ui32Error = m_pTransGizmo->save( pSave );
pSave->end_chunk();
// Save attribute gizmo
pSave->begin_chunk( CHUNK_TESTEFFECT_ATTRIBGIZMO, TESTEFFECT_VERSION );
ui32Error = m_pAttribGizmo->save( pSave );
pSave->end_chunk();
return ui32Error;
}
|
|
Default constructor.
|
|
|
Default destructor.
|
|
|
Begins a chunk a data.
Example: ...
// Begin new chunk of data.
pSave->begin_chunk( CHUNK_TGAIMPORT_NAME, TGAIMPORT_VERSION );
// Write data to a chunk.
sStr = m_sFileName;
if( sStr.size() > 255 )
sStr.resize( 255 );
ui32Error = pSave->write_str( sStr.c_str() );
// Close data chunk.
pSave->end_chunk();
... |
|
|
Flushes all buffers and closes output stream.
|
|
|
Closes a chunk. Calls to this method are hierarchial. There can be many chunks open at the same time. The chunk opened by the last call to begin_chunck() is closed.
|
|
|
Returns current error code.
|
|
|
Opens output stream. See FileIOErrorsE for more information on the error codes.
|
|
|
Writes a buffer to the stream.
|
|
|
Writes string to the stream.
|