Mod: replace std::ifstream/std::ofstream with Base::ifstream/Base::ofstream
This commit is contained in:
@@ -67,7 +67,9 @@
|
||||
#include <App/Material.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
@@ -1154,7 +1156,9 @@ void DrawUtil::copyFile(std::string inSpec, std::string outSpec)
|
||||
{
|
||||
// Base::Console().Message("DU::copyFile(%s, %s)\n", inSpec.c_str(), outSpec.c_str());
|
||||
if (inSpec.empty()) {
|
||||
std::ofstream output(outSpec);
|
||||
// create an empty file
|
||||
Base::FileInfo fi(outSpec);
|
||||
Base::ofstream output(fi);
|
||||
return;
|
||||
}
|
||||
Base::FileInfo fi(inSpec);
|
||||
|
||||
@@ -55,8 +55,8 @@ PyObject* DrawViewSymbolPy::dumpSymbol(PyObject *args)
|
||||
}
|
||||
|
||||
Base::FileInfo fi(fileSpec);
|
||||
std::ofstream outfile;
|
||||
outfile.open(fi.filePath());
|
||||
Base::ofstream outfile;
|
||||
outfile.open(fi);
|
||||
outfile.write (symbolRepr.c_str(),symbolRepr.size());
|
||||
outfile.close();
|
||||
if (outfile.good()) {
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
#include "Geometry.h"
|
||||
@@ -305,8 +306,9 @@ std::vector<PATLineSpec> PATLineSpec::getSpecsForPattern(std::string& parmFile,
|
||||
{
|
||||
std::vector<PATLineSpec> result;
|
||||
std::vector<std::string> lineSpecs;
|
||||
std::ifstream inFile;
|
||||
inFile.open (parmFile, std::ifstream::in);
|
||||
Base::FileInfo fi(parmFile);
|
||||
Base::ifstream inFile;
|
||||
inFile.open (fi, std::ifstream::in);
|
||||
if(!inFile.is_open()) {
|
||||
Base::Console().Message( "Cannot open input file.\n");
|
||||
return result;
|
||||
@@ -385,8 +387,9 @@ std::vector<std::string> PATLineSpec::loadPatternDef(std::ifstream& inFile)
|
||||
std::vector<std::string> PATLineSpec::getPatternList(std::string& parmFile)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
std::ifstream inFile;
|
||||
inFile.open (parmFile, std::ifstream::in);
|
||||
Base::FileInfo fi(parmFile);
|
||||
Base::ifstream inFile;
|
||||
inFile.open (fi, std::ifstream::in);
|
||||
if(!inFile.is_open()) {
|
||||
Base::Console().Message( "Cannot open input file.\n");
|
||||
return result;
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
#include <App/Application.h>
|
||||
#include <App/Material.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawUtil.h>
|
||||
@@ -231,7 +233,8 @@ void QGITile::makeText()
|
||||
//read whole text file into std::string
|
||||
std::string QGITile::getStringFromFile(std::string inSpec)
|
||||
{
|
||||
std::ifstream f(inSpec);
|
||||
Base::FileInfo fi(inSpec);
|
||||
Base::ifstream f(fi);
|
||||
std::stringstream ss;
|
||||
ss << f.rdbuf();
|
||||
return ss.str();
|
||||
|
||||
Reference in New Issue
Block a user