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

Method insertAsciiFile

src/Base/Writer.cpp:171–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void Writer::insertAsciiFile(const char* FileName)
172{
173 Base::FileInfo fi(FileName);
174 Base::ifstream from(fi);
175 if (!from) {
176 throw Base::FileException("Writer::insertAsciiFile() Could not open file!");
177 }
178
179 Stream() << "<![CDATA[";
180 char ch {};
181 while (from.get(ch)) {
182 Stream().put(ch);
183 }
184 Stream() << "]]>" << std::endl;
185
186 checkErrNo();
187}
188
189void Writer::insertBinFile(const char* FileName)
190{

Callers

nothing calls this directly

Calls 3

StreamFunction · 0.85
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected