1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

remove unused method FileIndex::findFile

This commit is contained in:
Daniel Evans 2016-09-06 23:03:45 +01:00
parent 5e0659fccf
commit d7dea62f04
3 changed files with 0 additions and 46 deletions

View File

@ -76,18 +76,6 @@ void FileIndex::indexArchive(const std::string& archive)
}
}
bool FileIndex::findFile(const std::string& filename, FileIndex::IndexData& filedata)
{
auto iterator = files.find(filename);
if( iterator == files.end() ) {
return false;
}
filedata = iterator->second;
return true;
}
FileHandle FileIndex::openFile(const std::string& filename)
{
auto iterator = files.find( filename );

View File

@ -92,13 +92,6 @@ public:
* file index.
*/
void indexArchive(const std::string& archive);
/**
* Returns true if the file identified by filename is found within
* the file index. If the file is found, the filedata parameter
* is populated.
*/
bool findFile(const std::string& filename, IndexData& filedata);
/**
* Returns a FileHandle for the file if it can be found in the

View File

@ -31,20 +31,6 @@ BOOST_AUTO_TEST_CASE(test_directory_paths)
}
}
BOOST_AUTO_TEST_CASE(test_index)
{
FileIndex index;
index.indexTree(Global::getGamePath()+"/data");
FileIndex::IndexData data;
BOOST_CHECK( index.findFile("cullzone.dat", data) );
BOOST_CHECK_EQUAL( data.filename, "cullzone.dat" );
BOOST_CHECK_EQUAL( data.originalName, "CULLZONE.DAT" );
BOOST_CHECK( data.archive.empty() );
}
BOOST_AUTO_TEST_CASE(test_file)
{
FileIndex index;
@ -55,19 +41,6 @@ BOOST_AUTO_TEST_CASE(test_file)
BOOST_CHECK( handle != nullptr );
}
BOOST_AUTO_TEST_CASE(test_index_archive)
{
FileIndex index;
index.indexArchive(Global::getGamePath()+"/models/gta3.img");
FileIndex::IndexData data;
BOOST_CHECK( index.findFile("landstal.dff", data) );
BOOST_CHECK_EQUAL( data.filename, "landstal.dff" );
BOOST_CHECK_EQUAL( data.originalName, "landstal.dff" );
BOOST_CHECK_EQUAL( data.archive, "gta3.img" );
}
BOOST_AUTO_TEST_CASE(test_file_archive)
{
FileIndex index;