-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reader.cpp
36 lines (34 loc) · 1.11 KB
/
Reader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
********************************************************************************/
#include <string> //value read
#include <iostream> //for cout
#include "Reader.h"
bool Reader::Read(std::string & firstItem)
{
while(GoodFileWData() && (file >> firstVal) )
if ( CheckSkipChars(firstVal) || CheckSkipWords(firstVal) )
SkipLine();
else
break;
//commented out debug because it only tells us we have successfully
//ignored comments and prints a lot of text to do so
/*
#ifndef NDEBUG
std::streampos pos = file.tellg();
std::string currLine;
if ( std::getline(file, currLine) )
{
if (file.eof())
file.clear();
std::cout << firstVal << currLine << std::endl;
file.seekg(-(currLine.size()+1), std::ios_base::cur);
}
#endif
*/
firstItem = firstVal;
return GoodFileWData();
}