Save a few lines in filefuncs.cpp.
This commit is contained in:
parent
ccba965402
commit
ea173db8f9
|
@ -7,8 +7,7 @@ using namespace std;
|
||||||
string getFileContent(const string& file)
|
string getFileContent(const string& file)
|
||||||
{
|
{
|
||||||
ifstream filetoParse;
|
ifstream filetoParse;
|
||||||
string lineinput;
|
string lineinput, fullinput;
|
||||||
string fullinput;
|
|
||||||
filetoParse.open(file, ios::in);
|
filetoParse.open(file, ios::in);
|
||||||
if (filetoParse.is_open()) while (getline(filetoParse, lineinput)) {
|
if (filetoParse.is_open()) while (getline(filetoParse, lineinput)) {
|
||||||
fullinput.append(lineinput + "\n");
|
fullinput.append(lineinput + "\n");
|
||||||
|
@ -17,8 +16,7 @@ string getFileContent(const string& file)
|
||||||
return fullinput;
|
return fullinput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOutputFileContent(const string& language, const string& file, const string& content)
|
void setOutputFileContent(const string& language, const string& file, const string& content) {
|
||||||
{
|
|
||||||
static ofstream outputFile (file, ofstream::out);
|
static ofstream outputFile (file, ofstream::out);
|
||||||
outputFile << content;
|
outputFile << content;
|
||||||
}
|
}
|
Loading…
Reference in New Issue