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

Method extractInputFile

src/App/ProjectFile.cpp:690–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690std::string ProjectFile::extractInputFile(const std::string& name)
691{
692 zipios::ZipFile project(stdFile);
693 std::unique_ptr<std::istream> str(project.getInputStream(name));
694 if (str) {
695 // write it to a tmp. file as writing to the string stream
696 // might take too long
697 Base::FileInfo fi(Base::FileInfo::getTempFileName());
698 Base::ofstream file(fi, std::ios::out | std::ios::binary);
699 std::streambuf* buf = file.rdbuf();
700 (*str) >> buf;
701 file.flush();
702 file.close();
703 return fi.filePath();
704 }
705
706 return {};
707}
708
709void ProjectFile::readInputFile(const std::string& name, std::ostream& str)
710{

Callers

nothing calls this directly

Calls 4

getInputStreamMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45
filePathMethod · 0.45

Tested by

no test coverage detected