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)
|
||||
{
|
||||
ifstream filetoParse;
|
||||
string lineinput;
|
||||
string fullinput;
|
||||
string lineinput, fullinput;
|
||||
filetoParse.open(file, ios::in);
|
||||
if (filetoParse.is_open()) while (getline(filetoParse, lineinput)) {
|
||||
fullinput.append(lineinput + "\n");
|
||||
|
@ -17,8 +16,7 @@ string getFileContent(const string& file)
|
|||
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);
|
||||
outputFile << content;
|
||||
}
|
Loading…
Reference in New Issue