MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / givenDataAsXMLStream

Method givenDataAsXMLStream

tests/src/Base/Reader.cpp:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
76private:
77 std::unique_ptr<Base::XMLReader> _reader;

Callers 1

TEST_FFunction · 0.80

Calls 7

stringMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
closeMethod · 0.45
openMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected