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 ) );
![]() | Creating RED streams![]() |