#include <FFStream.hpp>
Inheritance diagram for FFStream:


This is just a root class to provide the single point formatted i/o operators (such as '<<' & '>>' ).
As a special design consideration, all exceptions thrown are based on gpstk::Exception - all std::exception throws are rethrown as gpstk::Exception. Furthermore, exceptions will not be thrown unless exceptions are set to be thrown:
fs.exceptions(std::fstream::failbit);
fs is the name of your file stream. Then when an exception occurs, conditionalThrow() will throw the last thrown exception. Otherwise when an exception occurs, the stream sets ios::fail and will not read any more. Exceptions for this class store the record number of the file for when the exception occurred as well as the file name and any detailed information about the error. For gpstk::FFTextStream, the line number of the file where the error was found is also recorded, allowing for easy location of file problems.When operating on the file, recordNumber will automatically increment with each read and write operation. When a file is opened with the constructor or with open(), all internal FFStream variables are reset. Derived classes should make sure any of their internal variables are reset when either of those function are called.
Many file types have header data as part of the file format. When reading the file, the reader is not required to explicitly read in the header to access the data. To facilitate this, each of these stream classes has an internal header object that will store the header. The stream keeps track of whether it read the header or not, and reads the header if the internal state says it hasn't been read. When writing a file, the stream's internal header is used for those formats which use header information to determine what data is in the records. See RinexObsHeader::reallyGetRecord() and RinexObsData::reallyGetRecord() for an example of this.
RinexObsData::reallyGetRecord() and RinexObsHeader::reallyGetRecord() for more information for files that read header data.
Definition at line 130 of file FFStream.hpp.
Public Member Functions | |
| virtual | ~FFStream (void) |
| Virtual destructor. | |
| FFStream () | |
| Default constructor. | |
| FFStream (const char *fn, std::ios::openmode mode=std::ios::in) | |
| Common constructor. | |
| FFStream (const std::string &fn, std::ios::openmode mode=std::ios::in) | |
| Common constructor. | |
| virtual void | open (const char *fn, std::ios::openmode mode) |
| Overrides fstream:open so derived classes can make appropriate internal changes (line count, header info, etc). | |
| virtual void | open (const std::string &fn, std::ios::openmode mode) |
| Overrides fstream:open so derived classes can make appropriate internal changes (line count, header info, etc). | |
| void | dumpState (std::ostream &s=std::cout) const |
| A function to help debug FFStreams. | |
| void | conditionalThrow (void) throw (FFStreamError) |
| Throws mostRecentException only if the stream is enabled to throw exceptions when failbit is set. | |
Static Public Member Functions | |
| bool | IsFFStream (std::istream &i) |
| Check if the input stream is the kind of RinexObsStream. | |
Public Attributes | |
Data members | |
This stores the most recently thrown exception. | |
| FFStreamError | mostRecentException |
| unsigned int | recordNumber |
| keeps track of the number of records read | |
| std::string | filename |
| file name | |
Protected Member Functions | |
| virtual void | tryFFStreamGet (FFData &rec) throw (FFStreamError, gpstk::StringUtils::StringException) |
| Encapsulates shared try/catch blocks for all file types to hide std::exception. | |
| virtual void | tryFFStreamPut (const FFData &rec) throw (FFStreamError, gpstk::StringUtils::StringException) |
| Encapsulates shared try/catch blocks for all file types to hide std::exception. | |
Friends | |
| class | FFData |
| FFData is a friend so it can access the try* functions. | |
|
|
Virtual destructor.
Definition at line 135 of file FFStream.hpp. |
|
|
Default constructor.
Definition at line 141 of file FFStream.hpp. |
|
||||||||||||
|
Common constructor.
Definition at line 150 of file FFStream.hpp. |
|
||||||||||||
|
Common constructor.
Definition at line 160 of file FFStream.hpp. |
|
|
Throws mostRecentException only if the stream is enabled to throw exceptions when failbit is set. You can set this behavior with the following line of code: ffstreamobject.exceptions(ifstream::failbit); Definition at line 193 of file FFStream.hpp. |
|
|
A function to help debug FFStreams.
Definition at line 68 of file FFStream.cpp. References FFStream::filename. Referenced by gpstk::operator>>(). |
|
|
Check if the input stream is the kind of RinexObsStream.
Definition at line 204 of file FFStream.hpp. |
|
||||||||||||
|
Overrides fstream:open so derived classes can make appropriate internal changes (line count, header info, etc).
Reimplemented in FFTextStream, Rinex3ClockStream, Rinex3ObsStream, and RinexObsStream. Definition at line 176 of file FFStream.hpp. |
|
||||||||||||
|
Overrides fstream:open so derived classes can make appropriate internal changes (line count, header info, etc).
Reimplemented in AntexStream, AshtechStream, ATSStream, MDPStream, NovatelStream, BinexStream, FFBinaryStream, FFTextStream, FICAStream, FICStream, IonexStream, Rinex3ClockStream, Rinex3NavStream, Rinex3ObsStream, RinexClockStream, RinexMetStream, RinexNavStream, RinexObsStream, SEMStream, SMODFStream, SP3Stream, and YumaStream. Definition at line 55 of file FFStream.cpp. References FFStream::filename, and FFStream::recordNumber. |
|
|
Encapsulates shared try/catch blocks for all file types to hide std::exception.
Reimplemented in FFTextStream. Definition at line 95 of file FFStream.cpp. References FILE_LOCATION, and GPSTK_RETHROW. |
|
|
Encapsulates shared try/catch blocks for all file types to hide std::exception.
Reimplemented in FFTextStream. Definition at line 210 of file FFStream.cpp. References FILE_LOCATION, and GPSTK_RETHROW. |
|
|
FFData is a friend so it can access the try* functions.
Definition at line 236 of file FFStream.hpp. |
|
|
file name
Definition at line 230 of file FFStream.hpp. Referenced by FFStream::dumpState(), and FFStream::open(). |
|
|
Definition at line 222 of file FFStream.hpp. |
|
|
keeps track of the number of records read
Definition at line 226 of file FFStream.hpp. Referenced by main(), FFStream::open(), MDPHeader::reallyGetRecord(), FICData::reallyGetRecord(), and ATSData::reallyGetRecord(). |
1.3.9.1