85 const CFB::COMPOUND_FILE_ENTRY* root =
m_reader->GetRootEntry();
91 [
this](
const CFB::COMPOUND_FILE_ENTRY* tentry,
const CFB::utf16string& dir,
int level ) ->
int
97 [&](
const CFB::COMPOUND_FILE_ENTRY* entry,
const CFB::utf16string&,
int ) ->
int
99 std::wstring fileName = UTF16ToWstring( entry->name, entry->nameLen );
101 if(
m_reader->IsStream( entry ) && fileName == L
"Parameters" )
104 std::map<wxString, wxString> parameterProperties =
108 parameterProperties, wxT(
"PATTERN" ), wxT(
"" ) );
110 parameterProperties, wxT(
"PATTERN" ), wxT(
"" ) );
125 const CFB::COMPOUND_FILE_ENTRY* models_root =
nullptr;
126 const CFB::COMPOUND_FILE_ENTRY* models_data =
nullptr;
132 models_data =
FindStream( {
"Library",
"Models",
"Data" } );
142 std::vector<AMODEL> models;
148 models.push_back( elem );
152 m_reader->EnumFiles(
m_reader->GetRootEntry(), 2, [&](
const CFB::COMPOUND_FILE_ENTRY* entry,
const CFB::utf16string& dir,
int ) ->
int
157 if( m_reader->IsStream( entry ) )
160 std::string dir_str = UTF16ToUTF8( dir.c_str() );
161 std::string entry_str = UTF16ToUTF8( entry->name );
163 if( dir_str.compare(
"Library" ) == 0 && entry_str.compare(
"Models" ) == 0 )
178 [&](
const CFB::COMPOUND_FILE_ENTRY* stepEntry,
const CFB::utf16string&,
int ) ->
int
181 wxString fileName = UTF16ToUTF8( stepEntry->name, stepEntry->nameLen );
183 if( !fileName.ToLong( &fileNumber ) )
186 if( !m_reader->IsStream( stepEntry ) || fileNumber >=
long( models.size() ) )
189 size_t stepSize =
static_cast<size_t>( stepEntry->size );
190 std::vector<char> stepContent( stepSize );
193 m_reader->ReadFile( stepEntry, 0, stepContent.data(), stepSize );
195 if( stepContent.empty() )
201 wxString modelName = models[fileNumber].id;
202 m_libModelsCache.emplace( modelName, std::make_pair( std::move( models[fileNumber] ),
203 std::move( stepContent ) ) );