9 #ifndef THEPEG_CFileLineReader_H
10 #define THEPEG_CFileLineReader_H
15 #include "ThePEG/Config/ThePEG.h"
16 #include "CFileLineReader.fh"
78 void open(
string filename);
128 bool find(
string str)
const;
int bufflen
The length of the line buffer.
char * buff
The line buffer.
CFileLineReader()
The default constructor.
~CFileLineReader()
The destructor.
char getc()
Return the next character of the line-buffer.
This is the main namespace within which all identifiers in ThePEG are declared.
CFile file
The c-file to be read from.
Here is the documentation of the CFile class.
CFileLineReader & operator=(const CFileLineReader &)
The assignment operator is private and must never be called.
bool operator!()
Return true if a previous read failed.
void resetline()
Undo reading from the current line, ie.
bool bad
The current state is bad if a read has failed.
bool skip(char c)
Scan forward up and until the first occurrence of the given character.
void open(string filename)
Initialize with a filename.
CFileLineReader is a wrapper around a standard C FILE stream.
bool readline()
Read a line from the underlying c-file into the line buffer.
bool find(string str) const
Check if a given string is present in the current line buffer.
CFile cFile() const
Return the underlying c-file.
static const int defsize
The default size of the buffer.
string getline() const
Return a string containing what is left of the line buffer.
void close()
If the file was opened from within this object, close it.
CFileLineReader & operator>>(long &l)
Read a long from the line buffer.
char * pos
The current position in the line buffer.