1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-12-23 06:04:29 +00:00

Serial IO code cleaning for std:: convention

This commit is contained in:
2018-03-27 17:11:50 +01:00
parent 8a0cf0194f
commit 5ec903044d
4 changed files with 31 additions and 35 deletions

View File

@@ -30,17 +30,16 @@
#include <Grid/GridCore.h>
using namespace Grid;
using namespace std;
#define GRID_TEXT_INDENT 2 //number of spaces for indentation of levels
// Writer implementation ///////////////////////////////////////////////////////
TextWriter::TextWriter(const string &fileName)
: file_(fileName, ios::out)
TextWriter::TextWriter(const std::string &fileName)
: file_(fileName, std::ios::out)
{}
void TextWriter::push(const string &s)
void TextWriter::push(const std::string &s)
{
level_++;
};
@@ -58,16 +57,16 @@ void TextWriter::indent(void)
};
// Reader implementation ///////////////////////////////////////////////////////
TextReader::TextReader(const string &fileName)
TextReader::TextReader(const std::string &fileName)
{
file_.open(fileName, ios::in);
file_.open(fileName, std::ios::in);
if (!file_.is_open()) {
std::cout << GridLogMessage << "TextReader: Error opening file " << fileName << std::endl;
exit(1);// write better error handling
}
}
bool TextReader::push(const string &s)
bool TextReader::push(const std::string &s)
{
level_++;
return true;
@@ -91,7 +90,7 @@ void TextReader::checkIndent(void)
}
if (!check)
{
cerr << "TextReader: mismatch on level " << level_ << std::endl;
std::cerr << "TextReader: mismatch on level " << level_ << std::endl;
exit(1);
}
}