An FFStream is meant for reading text. This also includes an internal line count and a read line method. When reading and using the formattedGetLine() call, the lineNumber automatically increments. However, any other read and all write calls do not update the line number - the derived class or programmer needs to make sure that the reader or writer increments lineNumber in these cases.
Definition at line 63 of file FFTextStream.hpp.
#include <FFTextStream.hpp>
Public Member Functions | |
FFTextStream () | |
Default constructor. More... | |
FFTextStream (const char *fn, std::ios::openmode mode=std::ios::in) | |
FFTextStream (const std::string &fn, std::ios::openmode mode=std::ios::in) | |
void | formattedGetLine (std::string &line, const bool expectEOF=false) |
virtual void | open (const char *fn, std::ios::openmode mode) |
Overrides open to reset the line number. More... | |
virtual void | open (const std::string &fn, std::ios::openmode mode) |
Overrides open to reset the line number. More... | |
virtual | ~FFTextStream () |
Destructor. More... | |
![]() | |
void | conditionalThrow (void) |
void | dumpState (std::ostream &s=std::cout) const |
A function to help debug FFStreams. More... | |
FFStream () | |
Default constructor, initialize internal data. More... | |
FFStream (const char *fn, std::ios::openmode mode=std::ios::in) | |
FFStream (const std::string &fn, std::ios::openmode mode=std::ios::in) | |
virtual | ~FFStream () |
Virtual destructor, close the stream etc. More... | |
Public Attributes | |
unsigned int | lineNumber |
![]() | |
std::string | filename |
file name More... | |
FFStreamError | mostRecentException |
This stores the most recently thrown exception. More... | |
unsigned int | recordNumber |
keeps track of the number of records read More... | |
Protected Member Functions | |
virtual void | tryFFStreamGet (FFData &rec) |
virtual void | tryFFStreamPut (const FFData &rec) |
Private Member Functions | |
void | init () |
Initialize internal data structures. More... | |
Additional Inherited Members | |
![]() | |
static bool | isFFStream (std::istream &i) |
Check if the input stream is the kind of RinexObsStream. More... | |
gnsstk::FFTextStream::FFTextStream | ( | ) |
Default constructor.
Definition at line 49 of file FFTextStream.cpp.
|
virtual |
Destructor.
Definition at line 56 of file FFTextStream.cpp.
gnsstk::FFTextStream::FFTextStream | ( | const char * | fn, |
std::ios::openmode | mode = std::ios::in |
||
) |
Common constructor.
fn | file name. |
mode | file open mode (std::ios) |
Definition at line 62 of file FFTextStream.cpp.
gnsstk::FFTextStream::FFTextStream | ( | const std::string & | fn, |
std::ios::openmode | mode = std::ios::in |
||
) |
Common constructor.
fn | file name. |
mode | file open mode (std::ios) |
Definition at line 71 of file FFTextStream.cpp.
void gnsstk::FFTextStream::formattedGetLine | ( | std::string & | line, |
const bool | expectEOF = false |
||
) |
Like std::istream::getline but checks for EOF and removes '/r'. Also increments lineNumber. When expectEOF is true and EOF is found, an gnsstk::EndOfFile exception is thrown. If expectEOF is false and an EOF is encountered, an gnsstk::FFStreamError is thrown.
[out] | line | is set to the value of the line read from the file. |
[in] | expectEOF | set true if finding EOF on this read is acceptable. |
EndOfFile | if expectEOF is true and an EOF is encountered. |
FFStreamError | if EOF is found and expectEOF is false |
gnsstk::StringUtils::StringException | when a string error occurs or if any other error happens. |
Definition at line 149 of file FFTextStream.cpp.
|
private |
Initialize internal data structures.
Definition at line 97 of file FFTextStream.cpp.
|
virtual |
Overrides open to reset the line number.
Reimplemented from gnsstk::FFStream.
Reimplemented in gnsstk::RinexObsStream, gnsstk::Rinex3ObsStream, gnsstk::RinexClockStream, gnsstk::SEMStream, gnsstk::RinexMetStream, gnsstk::YumaStream, gnsstk::IonexStream, gnsstk::Rinex3NavStream, gnsstk::AntexStream, gnsstk::RinexNavStream, gnsstk::SP3Stream, and gnsstk::Rinex3ClockStream.
Definition at line 80 of file FFTextStream.cpp.
|
virtual |
Overrides open to reset the line number.
Reimplemented from gnsstk::FFStream.
Reimplemented in gnsstk::RinexObsStream, gnsstk::Rinex3ObsStream, and gnsstk::RinexClockStream.
Definition at line 89 of file FFTextStream.cpp.
|
protectedvirtual |
calls FFStream::tryFFStreamGet and adds line number information
FFStreamError | |
StringUtils::StringException |
Reimplemented from gnsstk::FFStream.
Definition at line 104 of file FFTextStream.cpp.
calls FFStream::tryFFStreamPut and adds line number information
FFStreamError | |
StringUtils::StringException |
Reimplemented from gnsstk::FFStream.
Definition at line 124 of file FFTextStream.cpp.
unsigned int gnsstk::FFTextStream::lineNumber |
The internal line count. When writing, make sure to increment this.
Definition at line 98 of file FFTextStream.hpp.