WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
WXP::MetarFile Class Reference

This class reads in raw METAR data. More...

#include "../include/MetarFile.h"

Public Member Functions

 MetarFile ()
 
 MetarFile (Filename &filename)
 
 ~MetarFile ()
 
int open (Filename &filename)
 
int init ()
 
bool isOpen ()
 
int rewind ()
 
int close ()
 
int checkType (char *filename)
 
int getLine (String &str)
 
char * getHeader ()
 

Static Public Attributes

static const int UNK = 0
 
static const int METAR = 1
 
static const int SPECI = 2
 

Detailed Description

This class reads in raw METAR data.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ MetarFile() [1/2]

MetarFile::MetarFile ( )

Constructor. Initializes data

◆ MetarFile() [2/2]

MetarFile::MetarFile ( Filename filename)

Constructor. Opens file.

Parameters
filenameFilename to open and parse

References open().

◆ ~MetarFile()

MetarFile::~MetarFile ( )

Destructor.

References WXP::File::close().

Member Function Documentation

◆ checkType()

int MetarFile::checkType ( char *  line)

Checks the type of data to determine whether a METAR report or not

Parameters
lineString to check

References WXP::StrLib::equal(), METAR, and SPECI.

Referenced by getLine().

◆ close()

int MetarFile::close ( )

Closes the file.

References WXP::File::close().

Referenced by open().

◆ getHeader()

char * MetarFile::getHeader ( )

Gets the latest WMO header from the file

Returns
String with the WMO header

◆ getLine()

int MetarFile::getLine ( String string)

Gets the next line with METAR data in it from the file.
Skips non-METAR data

Return values
stringString class to put data

References checkType(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::File::getLine(), WXP::StrLib::trimWS(), and UNK.

◆ isOpen()

bool MetarFile::isOpen ( )

Is file open

Returns
True if file open

◆ open()

int MetarFile::open ( Filename filename)

Opens a file for parsing

Parameters
filenameFilename to open

References close(), WXP::Filename::getName(), WXP::File::isOpen(), and WXP::File::open().

Referenced by MetarFile().

◆ rewind()

int MetarFile::rewind ( )

Rewinds the file

References WXP::File::rewind().

Member Data Documentation

◆ METAR

const int WXP::MetarFile::METAR = 1
static

Hourly METAR data

Referenced by checkType().

◆ SPECI

const int WXP::MetarFile::SPECI = 2
static

intermediate METAR specials

Referenced by checkType().

◆ UNK

const int WXP::MetarFile::UNK = 0
static

Unkown data

Referenced by getLine().


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