MCPcopy Create free account
hub / github.com/assimp/assimp / readData

Method readData

code/AssetLib/Q3BSP/Q3BSPFileParser.cpp:88–108  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

86
87// ------------------------------------------------------------------------------------------------
88bool Q3BSPFileParser::readData( const std::string &rMapName ) {
89 if ( !m_pZipArchive->Exists( rMapName.c_str() ) )
90 return false;
91
92 IOStream *pMapFile = m_pZipArchive->Open( rMapName.c_str() );
93 if ( nullptr == pMapFile )
94 return false;
95
96 const size_t size = pMapFile->FileSize();
97 m_Data.resize( size );
98
99 const size_t readSize = pMapFile->Read( &m_Data[0], sizeof( char ), size );
100 if ( readSize != size ) {
101 m_Data.clear();
102 m_pZipArchive->Close(pMapFile);
103 return false;
104 }
105 m_pZipArchive->Close( pMapFile );
106
107 return true;
108}
109
110// ------------------------------------------------------------------------------------------------
111bool Q3BSPFileParser::parseFile() {

Callers

nothing calls this directly

Calls 7

ExistsMethod · 0.45
OpenMethod · 0.45
FileSizeMethod · 0.45
resizeMethod · 0.45
ReadMethod · 0.45
clearMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected