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

This class parses text files. More...

#include "../include/WmoParse.h"

Public Types

enum  Type { RAW , WXP }
 

Public Member Functions

 WmoParse ()
 
 WmoParse (const char *str)
 
int init ()
 
int setParam (const char *str)
 
int open (Filename &filename)
 
int open (const char *filename)
 
bool isOpen ()
 
int rewind ()
 
int close ()
 
int useHdrFile (bool val)
 
int useAwipsHdr (bool val)
 
bool isNewProd ()
 
int setHeader (const char *string)
 
int setId (const char *id)
 
const char * getHeader ()
 
const char * getAwip ()
 
int getLineStatus ()
 
int tell ()
 
int seek (int loc)
 
int getLoc ()
 
int getHeaderLoc ()
 
int getFileInd ()
 
int setLoc (int byte)
 
int setLoc (int rind, int byte)
 
int peek (WmoProduct &prod)
 
int read (WmoProduct &prod)
 
int getLine (char *string, int len)
 
int getLine (String &line)
 
bool isData ()
 

Static Public Member Functions

static bool isStart (const char *line)
 
static bool compare (const char *header, const char *awip, const char *pattern)
 
static bool checkZone (const char *line, const char *str)
 

Static Public Attributes

static const int START = 0x1
 
static const int SEQ = 0x2
 
static const int HEADER = 0x3
 
static const int AWIP = 0x4
 
static const int SDATA = 0x5
 
static const int DATA = 0x10
 
static const int BLANK = 0x11
 
static const int DOLLAR = 0x12
 
static const int LOCATE = 0x13
 
static const int VTEC = 0x14
 
static const int LATLON = 0x15
 
static const int DESC = 0x16
 

Detailed Description

This class parses text files.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ WmoParse() [1/2]

WmoParse::WmoParse ( )

Constructor. Initializes class values

References init().

◆ WmoParse() [2/2]

WmoParse::WmoParse ( const char *  str)

Constructor

Parameters
strThe parameters to initialize object

References init().

Member Function Documentation

◆ close()

int WmoParse::close ( )

◆ compare()

bool WmoParse::compare ( const char *  header,
const char *  header2,
const char *  pattern 
)
static

Comparison routine for matching WMO headers

Parameters
patternPattern to match against current WMO and AWIP headers

References WXP::StrLib::equal(), WXP::Const::MISS, and WXP::Wxp::outDebug().

◆ getAwip()

const char * WmoParse::getAwip ( )

Gets the latest AWIP header

Returns
AWIP header

◆ getHeader()

const char * WmoParse::getHeader ( )

Gets the latest matching WMO header

Returns
WMO header string

Referenced by WXP::MosFile::getWmo(), WXP::MosUFile::getWmo(), and WXP::WarnFile::read().

◆ getHeaderLoc()

int WmoParse::getHeaderLoc ( )

Gets the location of the current header line in the file (byte offset)

Returns
The byte offset into file

◆ getLine() [1/2]

int WmoParse::getLine ( char *  line,
int  len 
)

◆ getLine() [2/2]

int WmoParse::getLine ( String string)

Gets the next matching line in the file

Return values
stringString class to put data

References getLine().

◆ getLoc()

int WmoParse::getLoc ( )

Gets the location of the current line in the file (byte offset)

Returns
The byte offset into file

Referenced by WXP::MosUFile::read().

◆ init()

int WmoParse::init ( )

Initializes class values

Referenced by WmoParse().

◆ isData()

bool WmoParse::isData ( )

Returns if the data output is valid data

Returns
True if valid data

◆ isNewProd()

bool WmoParse::isNewProd ( )

Is data part of a new product.

Returns
True if data first part of a new product. Clears after first valid data of new product.

Referenced by WXP::MosUFile::read(), and WXP::WarnFile::read().

◆ isOpen()

bool WmoParse::isOpen ( )

Is file open

Returns
True if file open

Referenced by WXP::WarnFile::isOpen(), WXP::WarnFile::open(), WXP::MosFile::open(), and WXP::MosUFile::open().

◆ open()

int WmoParse::open ( Filename rfilename)

◆ rewind()

int WmoParse::rewind ( )

Rewind the file

References WXP::File::rewind().

Referenced by WXP::MosFile::rewind(), and WXP::MosUFile::rewind().

◆ setHeader()

int WmoParse::setHeader ( const char *  str)

Sets the WMO header to search for

Parameters
strHeader string

References WXP::StrLib::copy().

Referenced by WXP::MosFile::setModel(), and WXP::MosUFile::setModel().

◆ setId()

int WmoParse::setId ( const char *  str)

Sets the string identifier to search for within product

Parameters
strId string to search for

References WXP::StrLib::copy().

◆ setLoc()

int WmoParse::setLoc ( int  byte)

Sets a new location in the file to start searching for data

Parameters
byteByte offset into file

References WXP::File::getLine(), WXP::File::rewind(), WXP::File::seek(), and WXP::File::tell().

◆ useHdrFile()

int WXP::WmoParse::useHdrFile ( bool  val)
inline

Determines if header file is to be used in parsing

Parameters
valTrue if header file is to be used.

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