| 62 | } |
| 63 | |
| 64 | void givenDataAsXMLStream(const std::string& data) |
| 65 | { |
| 66 | auto stringData = R"(<?xml version="1.0" encoding="UTF-8"?><document>)" + data |
| 67 | + "</document>"; |
| 68 | std::istringstream stream(stringData); |
| 69 | std::ofstream fileStream(_tempFile.string()); |
| 70 | fileStream.write(stringData.data(), static_cast<std::streamsize>(stringData.length())); |
| 71 | fileStream.close(); |
| 72 | inputStream.open(_tempFile.string()); |
| 73 | _reader = std::make_unique<Base::XMLReader>(_tempFile.string().c_str(), inputStream); |
| 74 | } |
| 75 | |
| 76 | private: |
| 77 | std::unique_ptr<Base::XMLReader> _reader; |