#include <FileSpec.hpp>
For instance, ASM%4Y.3j is the file spec for a SMODF file. The format is similar to what you would use in sprintf(), and specifically it uses the same fields as DayTime::printf(). For the most predictable results, fully specify the field length (as in 4Y vs. Y). Check the FileSpecType enum values for how characters map to fields. Any new fields added should conform to DayTime or already existing fields, if there are any.
Definition at line 91 of file FileSpec.hpp.
Public Types | ||||
| typedef std::map< FileSpecType, std::string > | FSTStringMap | |||
| A map from a FileSpecType to a string, used in the toString function. | ||||
| enum | FileSpecType { unknown, station, receiver, prn, selected, sequence, version, fixed, clock, text, year, month, dayofmonth, hour, minute, second, fsecond, gpsweek, fullgpsweek, gpssecond, mjd, dayofweek, day, doysecond, zcount, zcountfloor, unixsec, unixusec, fullzcount, end } | |||
| This enum lists the different possible elements you can have in a FileSpec. More... | ||||
| enum | FileSpecSortType { none, ascending, descending } | |||
| An enum for identifying the sort order of the list returned from FileHunter. More... | ||||
Public Member Functions | ||||
| FileSpec () | ||||
| Default constructor. | ||||
| FileSpec (const std::string &fileSpec) throw (FileSpecException) | ||||
| Constructor with a string to parse. | ||||
| virtual | ~FileSpec () | |||
| Destructor. | ||||
| virtual FileSpec & | newSpec (const std::string &fileSpec) throw (FileSpecException) | |||
| Reinitializes this FileSpec with the new string. | ||||
| virtual std::string | getSpecString (void) const | |||
| Returns the string of the filespec. | ||||
| virtual std::string | createSearchString () const throw (FileSpecException) | |||
| Returns a string that can be used to search for files matching this FileSpec. | ||||
| virtual std::string | extractField (const std::string &filename, const FileSpecType) const throw (FileSpecException) | |||
| Given a file name and a field, returns that field from the string. | ||||
| virtual bool | hasField (const FileSpecType) const throw (FileSpecException) | |||
| Given a field type, returns true if the FileSpec has that field. | ||||
| virtual gpstk::DayTime | extractDayTime (const std::string &filename) const throw (FileSpecException) | |||
| If possible, returns a DayTime object with the time the file represents. | ||||
| virtual std::string | toString (const gpstk::DayTime &dt, const FSTStringMap &fstsMap=FSTStringMap()) const | |||
| For the given FileSpec, fills in the fields with the given information and returns a string of that file name. | ||||
| virtual void | sortList (std::vector< std::string > &fileList, const FileSpecSortType fsst=ascending) const throw (FileSpecException) | |||
| Sort the list of files ascending or descending. | ||||
| virtual void | dump (std::ostream &o) const | |||
| semi-nicely print the FileSpec to the stream. | ||||
Static Public Member Functions | ||||
| std::string | convertFileSpecType (const FileSpecType) throw (FileSpecException) | |||
| Converts the FileSpecType to a string it is identified with. | ||||
| FileSpecType | convertFileSpecType (const std::string &) throw (FileSpecException) | |||
Converts the string into its corresponding FileSpecType
| ||||
Protected Member Functions | ||||
| virtual void | init (const std::string &fileSpec) throw (FileSpecException) | |||
| Parses the string into the FileSpec object. | ||||
Protected Attributes | ||||
| std::vector< FileSpecElement > | fileSpecList | |||
| Holds all of the FileSpecElements for this FileSpec. | ||||
| std::string | fileSpecString | |||
| Holds the string that the fileSpecList was generated from. | ||||
|
|
A map from a FileSpecType to a string, used in the toString function.
Definition at line 145 of file FileSpec.hpp. |
|
|
An enum for identifying the sort order of the list returned from FileHunter.
Definition at line 150 of file FileSpec.hpp. |
|
|
This enum lists the different possible elements you can have in a FileSpec.
Definition at line 104 of file FileSpec.hpp. |
|
|
Default constructor.
Definition at line 158 of file FileSpec.hpp. |
|
|
Constructor with a string to parse.
Definition at line 161 of file FileSpec.hpp. |
|
|
Destructor.
Definition at line 166 of file FileSpec.hpp. |
|
|
Converts the string into its corresponding FileSpecType
Definition at line 129 of file FileSpec.cpp. References GPSTK_THROW. |
|
|
Converts the FileSpecType to a string it is identified with.
Definition at line 90 of file FileSpec.cpp. References gpstk::StringUtils::asString(), and GPSTK_THROW. Referenced by FileSpec::dump(). |
|
|
Returns a string that can be used to search for files matching this FileSpec. Essentailly turns every non-fixed field into strings of '?'.
Definition at line 170 of file FileSpec.cpp. References gpstk::StringUtils::asString(), FileSpec::fileSpecList, and GPSTK_THROW. |
|
|
semi-nicely print the FileSpec to the stream.
Definition at line 422 of file FileSpec.cpp. References FileSpec::convertFileSpecType(), FileSpec::fileSpecList, and FileSpec::fileSpecString. Referenced by main(). |
|
|
If possible, returns a DayTime object with the time the file represents. Since the time resolution only goes to days for most file types, all times are set to midnight of that day.
Definition at line 255 of file FileSpec.cpp. References Exception::addText(), GPSTK_THROW, and DayTime::setToString(). Referenced by main(). |
|
||||||||||||
|
Given a file name and a field, returns that field from the string. Use hasField() first to see if the field exists in the FileSpec. If multiple fields of FileSpecType are defined, only the first is returned.
Definition at line 203 of file FileSpec.cpp. References GPSTK_THROW. Referenced by main(). |
|
|
Returns the string of the filespec.
Definition at line 174 of file FileSpec.hpp. |
|
|
Given a field type, returns true if the FileSpec has that field.
Definition at line 234 of file FileSpec.cpp. References GPSTK_THROW. |
|
|
Parses the string into the FileSpec object.
Definition at line 440 of file FileSpec.cpp. References Exception::addText(), gpstk::StringUtils::asInt(), gpstk::StringUtils::asString(), GPSTK_RETHROW, GPSTK_THROW, and gpstk::StringUtils::stripLeading(). |
|
|
Reinitializes this FileSpec with the new string.
Definition at line 169 of file FileSpec.hpp. Referenced by main(), and FileFilterFrame::newSource(). |
|
||||||||||||
|
Sort the list of files ascending or descending. The fields of the files are sorted in the order that they're specified in the FileSpecType enum. The list fileList is modified as a result of this. If the files in fileList have paths listed, then only the file name (taken to be the word after the last '/') will be used in the comparison. This function also filters out older versions of files in the fileList. Definition at line 329 of file FileSpec.cpp. |
|
||||||||||||
|
For the given FileSpec, fills in the fields with the given information and returns a string of that file name. Use the FSTStringMap to provide all the other non-time data for the string (i.e. FSTSMap[station] = "85408";). Any unspecified field will be filled with 0's. The one side affect of this is that you can only specify one of each field in the map, but you're likely not going to need two different station numbers in the file name. If you want, you can put the daytime information into the FSTSMap, but it's not necessary.
Definition at line 287 of file FileSpec.cpp. References FileSpec::fileSpecList, DayTime::printf(), and gpstk::StringUtils::rightJustify(). Referenced by main(), and RTFileFrame::openCurrentFile(). |
|
|
Holds all of the FileSpecElements for this FileSpec.
Definition at line 318 of file FileSpec.hpp. Referenced by FileSpec::createSearchString(), FileSpec::dump(), and FileSpec::toString(). |
|
|
Holds the string that the fileSpecList was generated from.
Definition at line 320 of file FileSpec.hpp. Referenced by FileSpec::dump(). |
1.3.9.1