FileFilterFrameWithHeader Class Template Reference
[File and Directory Processing Utilities]

#include <FileFilterFrameWithHeader.hpp>

Inheritance diagram for FileFilterFrameWithHeader:

Inheritance graph
[legend]
Collaboration diagram for FileFilterFrameWithHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class FileStream, class FileData, class FileHeader>
class gpstk::FileFilterFrameWithHeader< FileStream, FileData, FileHeader >

This is just like FileFilterFrame but it can also handle header data.

The header data is stored in an internal list that can be accessed with the *Header() methods below. Certain classes (like RINEX Obs and Met) have filter functions that can be used with touch() to combine header data from various files. The merge utilities in wonky use this ability, and other file types with header data can benefit from using this class's ability to store and write header data - see the RINEX and FIC GFW classes for more examples.

When initializing, this uses the FileFilterFrame::init() to read the FileData into the filter, then does a second pass with its own init() function to read the headers from those files. This is a little inefficient, but the goal of these classes was never efficiency.

Definition at line 78 of file FileFilterFrameWithHeader.hpp.

Public Member Functions

 FileFilterFrameWithHeader (const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Default constructor.
 FileFilterFrameWithHeader (const std::vector< std::string > &fileList, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Takes a list of files to open in lieu of day times.
 FileFilterFrameWithHeader (const std::string &filename, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Takes a file name for a single file filter.
 FileFilterFrameWithHeader (const FileSpec &spec, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME, const std::vector< FileHunter::FilterPair > &filter=std::vector< FileHunter::FilterPair >()) throw (gpstk::Exception)
 Uses the FileSpec to retrieve files.
FileFilterFrameWithHeadernewSource (const FileSpec &filespec, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME, const std::vector< FileHunter::FilterPair > &filter=std::vector< FileHunter::FilterPair >()) throw (gpstk::Exception)
 Gets the files from the file spec and the time, then adds the data to the filter.
FileFilterFrameWithHeadernewSource (const std::string &filename, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Reads in the file and adds the data to the filter.
FileFilterFrameWithHeadernewSource (const std::vector< std::string > &fileList, const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Reads in the file and adds the data to the filter.
virtual ~FileFilterFrameWithHeader ()
bool writeFile (const std::string &outputFile, const FileHeader &fh) const throw (gpstk::Exception)
 Writes the data to the file outputFile with the given header.
template<class Operation>
FileFilterFrameWithHeadertouchHeader (Operation &op)
 performs the operation op on the header list.
std::list< FileHeader > & getHeaderData (void)
 Returns the contents of the header data list.
std::list< FileHeader > getHeaderData (void) const
 Returns the contents of the header data list, const.
std::list< FileHeader >::size_type getHeaderCount (void) const
 Returns the number of data items in the header list.
std::list< FileHeader >::const_iterator beginHeader () const throw (gpstk::InvalidRequest)
std::list< FileHeader >::const_iterator endHeader () const throw (gpstk::InvalidRequest)
std::list< FileHeader >::iterator beginHeader () throw (gpstk::InvalidRequest)
std::list< FileHeader >::iterator endHeader () throw (gpstk::InvalidRequest)
bool emptyHeader () const
std::list< FileHeader >::size_type sizeHeader ()
FileHeader & frontHeader () throw (gpstk::InvalidRequest)
const FileHeader & frontHeader () const throw (gpstk::InvalidRequest)
FileHeader & backHeader () throw (gpstk::InvalidRequest)
const FileHeader & backHeader () const throw (gpstk::InvalidRequest)

Protected Member Functions

void init (const std::vector< FileHunter::FilterPair > &filter=std::vector< FileHunter::FilterPair >()) throw (gpstk::Exception)
 Run init() to load the data into the filter.
void chl (const std::string &req) throw (gpstk::InvalidRequest)
 Check to make sure headerList is empty
Exceptions:
InvalidRequest if headerList is empty.


Protected Attributes

std::list< FileHeader > headerList


Constructor & Destructor Documentation

FileFilterFrameWithHeader const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception) [inline]
 

Default constructor.

Definition at line 83 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader const std::vector< std::string > &  fileList,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception) [inline]
 

Takes a list of files to open in lieu of day times.

Definition at line 92 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader const std::string &  filename,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception) [inline]
 

Takes a file name for a single file filter.

This can throw an exception when there's a file error.

Definition at line 111 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader const FileSpec spec,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME,
const std::vector< FileHunter::FilterPair > &  filter = std::vector<FileHunter::FilterPair>()
throw (gpstk::Exception) [inline]
 

Uses the FileSpec to retrieve files.

Use filter like you would in FileHunter, to filter FOR stations, receivers, etc. This can throw an exception when there's a file error.

Definition at line 123 of file FileFilterFrameWithHeader.hpp.

virtual ~FileFilterFrameWithHeader  )  [inline, virtual]
 

Definition at line 188 of file FileFilterFrameWithHeader.hpp.


Member Function Documentation

const FileHeader & backHeader  )  const throw (gpstk::InvalidRequest)
 

Definition at line 385 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

FileHeader & backHeader  )  throw (gpstk::InvalidRequest)
 

Definition at line 373 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

std::list< FileHeader >::iterator beginHeader  )  throw (gpstk::InvalidRequest)
 

Definition at line 326 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

std::list< FileHeader >::const_iterator beginHeader  )  const throw (gpstk::InvalidRequest)
 

Definition at line 304 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

void chl const std::string &  req  )  throw (gpstk::InvalidRequest) [inline, protected]
 

Check to make sure headerList is empty

Exceptions:
InvalidRequest if headerList is empty.

Definition at line 264 of file FileFilterFrameWithHeader.hpp.

References GPSTK_THROW.

Referenced by FileFilterFrameWithHeader::backHeader(), FileFilterFrameWithHeader::beginHeader(), FileFilterFrameWithHeader::endHeader(), and FileFilterFrameWithHeader::frontHeader().

bool emptyHeader  )  const [inline]
 

Definition at line 238 of file FileFilterFrameWithHeader.hpp.

std::list< FileHeader >::iterator endHeader  )  throw (gpstk::InvalidRequest)
 

Definition at line 338 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

std::list< FileHeader >::const_iterator endHeader  )  const throw (gpstk::InvalidRequest)
 

Definition at line 315 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

const FileHeader & frontHeader  )  const throw (gpstk::InvalidRequest)
 

Definition at line 361 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

FileHeader & frontHeader  )  throw (gpstk::InvalidRequest)
 

Definition at line 349 of file FileFilterFrameWithHeader.hpp.

References FileFilterFrameWithHeader::chl(), GPSTK_RETHROW, and FileFilterFrameWithHeader::headerList.

std::list<FileHeader>::size_type getHeaderCount void   )  const [inline]
 

Returns the number of data items in the header list.

Definition at line 223 of file FileFilterFrameWithHeader.hpp.

std::list<FileHeader> getHeaderData void   )  const [inline]
 

Returns the contents of the header data list, const.

Definition at line 220 of file FileFilterFrameWithHeader.hpp.

std::list<FileHeader>& getHeaderData void   )  [inline]
 

Returns the contents of the header data list.

Definition at line 217 of file FileFilterFrameWithHeader.hpp.

void init const std::vector< FileHunter::FilterPair > &  filter = std::vector< FileHunter::FilterPair >()  )  throw (gpstk::Exception) [protected]
 

Run init() to load the data into the filter.

Reimplemented from FileFilterFrame.

Definition at line 397 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader& newSource const std::vector< std::string > &  fileList,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception) [inline]
 

Reads in the file and adds the data to the filter.

Reimplemented from FileFilterFrame.

Definition at line 170 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader& newSource const std::string &  filename,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception) [inline]
 

Reads in the file and adds the data to the filter.

Reimplemented from FileFilterFrame.

Definition at line 155 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader& newSource const FileSpec filespec,
const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME,
const std::vector< FileHunter::FilterPair > &  filter = std::vector<FileHunter::FilterPair>()
throw (gpstk::Exception) [inline]
 

Gets the files from the file spec and the time, then adds the data to the filter.

Use filter like you would in FileHunter, to filter FOR stations, receivers, etc.

Reimplemented from FileFilterFrame.

Definition at line 138 of file FileFilterFrameWithHeader.hpp.

std::list<FileHeader>::size_type sizeHeader  )  [inline]
 

Definition at line 241 of file FileFilterFrameWithHeader.hpp.

FileFilterFrameWithHeader& touchHeader Operation &  op  )  [inline]
 

performs the operation op on the header list.

Definition at line 203 of file FileFilterFrameWithHeader.hpp.

bool writeFile const std::string &  outputFile,
const FileHeader &  fh
const throw (gpstk::Exception)
 

Writes the data to the file outputFile with the given header.

This will overwrite any existing file with the same name. This can throw an exception when there's a file error.

Returns:
true when it works.
Warning:
This will not write out headers for files that need them.

Definition at line 282 of file FileFilterFrameWithHeader.hpp.

References index(), and gpstk::FileUtils::makeDir().


Member Data Documentation

std::list<FileHeader> headerList [protected]
 

Definition at line 275 of file FileFilterFrameWithHeader.hpp.

Referenced by FileFilterFrameWithHeader::backHeader(), FileFilterFrameWithHeader::beginHeader(), FileFilterFrameWithHeader::endHeader(), and FileFilterFrameWithHeader::frontHeader().


The documentation for this class was generated from the following file:
Generated on Thu Feb 9 03:31:36 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1