Creating a .red File
The .red file API is exposed through the RED::IREDFile
interface. To create an instance of a .red file, you need to use the RED::Factory
:
RED::Object* red_file = RED::Factory::CreateInstance( CID_REDFile );
and get back its interface with:
RED::IREDFile* ired_file = red_file->As< RED::IREDFile >();
The last thing to do is to get access to the file content:
Case of File on Disk
RC_TEST( ired_file->Create( "./my_file.red" ) );
More Generic Case of a RED::IStream
// stream is a pointer to a RED stream.
RC_TEST( ired_file->Create( stream ) );