engiSaveModelByStream
Syntax
// // Strong typing definition // void engiSaveModelByStream( SdaiModel model, const void * callback, int_t size ); // // Weak typing definition // void __declspec(dllexport) __stdcall engiSaveModelByStream( int_t model, const void * callback, int_t size );
Property model
Size: 32 bit / 4 byte (value)Property callback
Size: 32 bit / 4 byte (reference)Property size
Size: 32 bit / 4 byte (value)
Example (based on pure API calls)
Here you can find code snippits that show how the API call engiSaveModelByStream can be used.
#include "./include/ifcengine.h" #include <assert.h> const int_t BLOCK_LENGTH_WRITE = 20000; // no maximum limit FILE * myFileWrite = nullptr; void __stdcall WriteCallBackFunction(unsigned char * content, int64_t size) { fwrite(content, (size_t) size, 1, myFileWrite); } void SaveModelByStream(SdaiModel model, wchar_t * fileName) { assert(myFileWrite == nullptr); _wfopen_s(&myFileWrite, fileName, L"wb"); if (&myFileWrite) { engiSaveModelByStream(model, &WriteCallBackFunction, BLOCK_LENGTH_WRITE); fclose(myFileWrite); } else { assert(false); } }