engiOpenModelByStream
Syntax
// // Strong typing definition // SdaiModel engiOpenModelByStream( SdaiRep repository, const void * callback, const char * schemaName ); static inline SdaiModel engiOpenModelByStream( SdaiRep repository, const void * callback, char * schemaName ) { return engiOpenModelByStream( repository, callback, (const char*) schemaName ); } // // Weak typing definition // int_t __declspec(dllexport) __stdcall engiOpenModelByStream( int_t repository, const void * callback, const char * schemaName ); static inline int_t engiOpenModelByStream( int_t repository, const void * callback, char * schemaName ) { return engiOpenModelByStream( repository, callback, (const char*) schemaName ); }
Property repository
Size: 64 bit / 8 byte (value)Property callback
Size: 64 bit / 8 byte (reference)Property schemaName
Size: 64 bit / 8 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call engiOpenModelByStream can be used.
#include "./include/ifcengine.h" #include <assert.h> const int_t BLOCK_LENGTH_READ = 20000; // MAX: 65535 FILE * myFileRead = nullptr; int_t __stdcall ReadCallBackFunction(unsigned char * content) { if (myFileRead == nullptr || feof(myFileRead)) { return -1; } int_t size = fread(content, 1, BLOCK_LENGTH_READ, myFileRead); return size; } SdaiModel OpenModelByStream(wchar_t * fileName) { assert(myFileRead == nullptr); _wfopen_s(&myFileRead, fileName, L"rb"); if (&myFileRead) { SdaiModel model = engiOpenModelByStream(0, &ReadCallBackFunction, ""); fclose(myFileRead); myFileRead = nullptr; return model; } assert(false); return 0; }