FileFilterFrame Class Template Reference
[File and Directory Processing Utilities]

#include <FileFilterFrame.hpp>

Inheritance diagram for FileFilterFrame:

Inheritance graph
[legend]
Collaboration diagram for FileFilterFrame:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class FileStream, class FileData>
class gpstk::FileFilterFrame< FileStream, FileData >

This class is a wrapper for FileHunter and FileFilter, allowing you to easily pick what files you want to process and how to process them.

In the constructors, providing a start and end time will allow FileHunter to pick the correct files for that date range. After the object is built, it is ready for filtering.

Use the filter(), sort(), unique() and touch() operators to run whatever operations you want to on the data, then write out the files when you're done. You can also get access to the data with getData() and run whatever other post processing tools you would like to.

See the examples in FileFilterFrameTest.cpp for a demonstration.

Definition at line 80 of file FileFilterFrame.hpp.

Public Member Functions

 FileFilterFrame (const gpstk::DayTime &start=gpstk::DayTime::BEGINNING_OF_TIME, const gpstk::DayTime &end=gpstk::DayTime::END_OF_TIME) throw (gpstk::Exception)
 Default constructor.
 FileFilterFrame (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.
 FileFilterFrame (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.
 FileFilterFrame (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.
FileFilterFramenewSource (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.
FileFilterFramenewSource (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.
FileFilterFramenewSource (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.
virtual ~FileFilterFrame ()
bool writeFile (const std::string &outputFile, const bool append=false) const throw (gpstk::Exception)
 Writes the data to the file outputFile, truncating the output file if it already exists unless append is true.
bool writeFile (FileStream &stream) const throw (gpstk::Exception)
 Writes the data to the supplied stream.

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.

Protected Attributes

FileSpec fs
 The file spec for this filter.
gpstk::DayTime startTime
 the start and end dates for the filter.
gpstk::DayTime endTime
 the start and end dates for the filter.


Constructor & Destructor Documentation

FileFilterFrame const gpstk::DayTime start = gpstk::DayTime::BEGINNING_OF_TIME,
const gpstk::DayTime end = gpstk::DayTime::END_OF_TIME
throw (gpstk::Exception)
 

Default constructor.

Definition at line 197 of file FileFilterFrame.hpp.

FileFilterFrame 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.

Definition at line 205 of file FileFilterFrame.hpp.

FileFilterFrame 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.

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

Definition at line 221 of file FileFilterFrame.hpp.

FileFilterFrame 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.

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 232 of file FileFilterFrame.hpp.

virtual ~FileFilterFrame  )  [inline, virtual]
 

Definition at line 150 of file FileFilterFrame.hpp.


Member Function Documentation

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 in FileFilterFrameWithHeader.

Definition at line 298 of file FileFilterFrame.hpp.

References FileHunter::find(), and FileHunter::setFilter().

FileFilterFrame< FileStream, FileData > & 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)
 

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

Reimplemented in FileFilterFrameWithHeader.

Definition at line 278 of file FileFilterFrame.hpp.

References FileSpec::end, and FileSpec::newSpec().

FileFilterFrame< FileStream, FileData > & 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)
 

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

Reimplemented in FileFilterFrameWithHeader.

Definition at line 262 of file FileFilterFrame.hpp.

References FileSpec::newSpec().

FileFilterFrame< FileStream, FileData > & 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)
 

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 in FileFilterFrameWithHeader.

Definition at line 245 of file FileFilterFrame.hpp.

bool writeFile FileStream &  stream  )  const throw (gpstk::Exception)
 

Writes the data to the supplied stream.

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, and files that depend on header data will (like RINEX) will not be written correctly with this function. Use FileFilterFrameWithHeader for those file types.

Definition at line 361 of file FileFilterFrame.hpp.

References index().

bool writeFile const std::string &  outputFile,
const bool  append = false
const throw (gpstk::Exception)
 

Writes the data to the file outputFile, truncating the output file if it already exists unless append is true.

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, and files that depend on header data will (like RINEX) will not be written correctly with this function. Use FileFilterFrameWithHeader for those file types.

Definition at line 337 of file FileFilterFrame.hpp.

References gpstk::FileUtils::makeDir().


Member Data Documentation

gpstk::DayTime endTime [protected]
 

the start and end dates for the filter.

Definition at line 189 of file FileFilterFrame.hpp.

FileSpec fs [protected]
 

The file spec for this filter.

Definition at line 187 of file FileFilterFrame.hpp.

gpstk::DayTime startTime [protected]
 

the start and end dates for the filter.

Definition at line 189 of file FileFilterFrame.hpp.


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