WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
WXP::SfcWmoFile Class Reference

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)

Detailed Description

This class reads in surface data from a input raw data file from file.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ SfcWmoFile() [1/2]

SfcWmoFile::SfcWmoFile ( )

Constructor

◆ SfcWmoFile() [2/2]

SfcWmoFile::SfcWmoFile ( const char * filename)

Constructor. Opens the surface data file (access=READ, type=UNK)

Parameters
filenameFile to open

References open().

◆ ~SfcWmoFile()

SfcWmoFile::~SfcWmoFile ( )

Destructor

Member Function Documentation

◆ checkHeader()

int SfcWmoFile::checkHeader ( const char * line)

Checks the WMO header to determine location of data. Saves to private location variable.

Parameters
lineWMO header data

References WXP::StrLib::check(), WXP::StrLib::copy(), WXP::Wxp::outDebug(), and WXP::StrLib::valid().

Referenced by read().

◆ checkStart()

int SfcWmoFile::checkStart ( const char * line)

Checks line to determine valid METAR/SAO report.

Parameters
lineInput line from file
Returns
Type of data

References WXP::StrLib::check(), WXP::StrLib::equal(), WXP::StrLib::isNum(), and WXP::StrLib::valid().

Referenced by read().

◆ checkType()

int SfcWmoFile::checkType ( const char * filename)
static

Checks the type of data in the file

Parameters
filenameFile to check

◆ close()

int SfcWmoFile::close ( )

Closes the surface data file

◆ getDate()

int SfcWmoFile::getDate ( Date & rdate)

Gets the date of the file

Return values
rdateDate class to put date information

◆ open()

int SfcWmoFile::open ( const char * filename)

Opens the raw surface data file

Parameters
filenameFile to open

Referenced by SfcWmoFile().

◆ read()

int SfcWmoFile::read ( SfcWmoData & data)

Reads a single report/station from the data file

Return values
dataSfcData 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().

◆ rewind()

int SfcWmoFile::rewind ( )

Rewinds the surface data file

◆ setDate()

int SfcWmoFile::setDate ( Date & rdate)

Sets the date of the file

Return values
rdateDate class to put date information

The documentation for this class was generated from the following files: