| 41 | } |
| 42 | |
| 43 | IDataStream* ExportDataManager::getData(const std::string& _name) const |
| 44 | { |
| 45 | std::string filepath = getDataPath(_name); |
| 46 | if (filepath.empty()) |
| 47 | return nullptr; |
| 48 | |
| 49 | auto stream = std::make_unique<std::ifstream>(); |
| 50 | stream->open(filepath.c_str(), std::ios_base::binary); |
| 51 | |
| 52 | if (!stream->is_open()) |
| 53 | return nullptr; |
| 54 | |
| 55 | DataFileStream* data = new DataFileStream(std::move(stream)); |
| 56 | |
| 57 | return data; |
| 58 | } |
| 59 | |
| 60 | void ExportDataManager::freeData(IDataStream* _data) |
| 61 | { |