mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-25 05:41:53 +00:00
Add base for menu parsing integration tests
This commit is contained in:
27
test/ObjLoadingTests/Mock/MockSearchPath.cpp
Normal file
27
test/ObjLoadingTests/Mock/MockSearchPath.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include "MockSearchPath.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void MockSearchPath::AddFileData(std::string fileName, std::string fileData)
|
||||
{
|
||||
m_file_data_map.emplace(std::make_pair(std::move(fileName), std::move(fileData)));
|
||||
}
|
||||
|
||||
SearchPathOpenFile MockSearchPath::Open(const std::string& fileName)
|
||||
{
|
||||
const auto foundFileData = m_file_data_map.find(fileName);
|
||||
|
||||
if(foundFileData == m_file_data_map.end())
|
||||
return {};
|
||||
|
||||
return {std::make_unique<std::istringstream>(foundFileData->second), foundFileData->second.size()};
|
||||
}
|
||||
|
||||
std::string MockSearchPath::GetPath()
|
||||
{
|
||||
return "MockFiles";
|
||||
}
|
||||
|
||||
void MockSearchPath::Find(const SearchPathSearchOptions& options, const std::function<void(const std::string&)>& callback)
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user