WXP C++ Library Version 6.74.9
|
This class reads in surface data from a input raw data file from file. More...
#include "../include/SfcWmoFile.h"
Public Types | |
enum | Type { UNK , WXP , LDM } |
Public Member Functions | |
SfcWmoFile () | |
SfcWmoFile (const char *filename) | |
~SfcWmoFile () | |
int | init () |
bool | isOpen () |
int | open (const char *filename) |
int | open (Filename &filename) |
int | rewind () |
int | close () |
int | setDate (Date &rdate) |
int | getDate (Date &rdate) |
int | checkHeader (const char *line) |
int | checkStart (const char *line) |
int | checkEnd (const char *line) |
int | read (SfcWmoData &data) |
Static Public Member Functions | |
static int | checkType (const char *filename) |
This class reads in surface data from a input raw data file from file.
SfcWmoFile::SfcWmoFile | ( | ) |
Constructor
SfcWmoFile::SfcWmoFile | ( | const char * | filename | ) |
SfcWmoFile::~SfcWmoFile | ( | ) |
Destructor
int SfcWmoFile::checkHeader | ( | const char * | line | ) |
Checks the WMO header to determine location of data. Saves to private location variable.
line | WMO header data |
References WXP::StrLib::check(), WXP::StrLib::copy(), WXP::Wxp::outDebug(), and WXP::StrLib::valid().
Referenced by read().
int SfcWmoFile::checkStart | ( | const char * | line | ) |
Checks line to determine valid METAR/SAO report.
line | Input line from file |
References WXP::StrLib::check(), WXP::StrLib::equal(), WXP::StrLib::isNum(), and WXP::StrLib::valid().
Referenced by read().
|
static |
Checks the type of data in the file
filename | File to check |
References WXP::File::isOpen(), and WXP::File::scanf().
int SfcWmoFile::close | ( | ) |
Closes the surface data file
int SfcWmoFile::getDate | ( | Date & | rdate | ) |
Gets the date of the file
rdate | Date class to put date information |
int SfcWmoFile::open | ( | const char * | filename | ) |
Opens the raw surface data file
filename | File to open |
References WXP::File::isOpen(), and WXP::File::open().
Referenced by SfcWmoFile().
int SfcWmoFile::read | ( | SfcWmoData & | data | ) |
Reads a single report/station from the data file
data | SfcData class to put the data from the file |
References WXP::StrLib::append(), checkHeader(), checkStart(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::Wxp::isDebug(), and WXP::StrLib::trimWS().
int SfcWmoFile::rewind | ( | ) |
Rewinds the surface data file
int SfcWmoFile::setDate | ( | Date & | rdate | ) |
Sets the date of the file
rdate | Date class to put date information |