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

Method SaveDocFile

src/App/VRMLObject.cpp:176–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void VRMLObject::SaveDocFile(Base::Writer& writer) const
177{
178 // store the inline files of the VRML file
179 if (this->indexSave < Urls.getSize()) {
180 std::string url = Urls[this->indexSave];
181
182 Base::FileInfo fi(url);
183 // it can happen that the transient directory has changed after
184 // saving the 'URLs' in RestoreDocFile() and then we have to
185 // try again with the new transient directory.
186 if (!fi.exists()) {
187 std::string path = getDocument()->TransientDir.getValue();
188 url = Resources[this->indexSave];
189 url = path + "/" + url;
190 fi.setFile(url);
191 }
192
193 this->indexSave++;
194 Base::ifstream file(fi, std::ios::in | std::ios::binary);
195 if (file) {
196 writer.Stream() << file.rdbuf();
197 }
198 }
199}
200
201bool VRMLObject::restoreTextureFinished(Base::Reader& reader)
202{

Callers 1

replacePropertyFilesMethod · 0.45

Calls 5

getDocumentFunction · 0.50
getSizeMethod · 0.45
existsMethod · 0.45
getValueMethod · 0.45
setFileMethod · 0.45

Tested by

no test coverage detected