WXP C++ Library Version 6.74.9
|
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) |
This class parses text files.
WmoParse::WmoParse | ( | ) |
Constructor. Initializes class values
References init().
WmoParse::WmoParse | ( | const char * | str | ) |
int WmoParse::close | ( | ) |
Closes the file
References WXP::File::close().
Referenced by WXP::MosFile::close(), WXP::MosUFile::close(), WXP::WarnFile::close(), WXP::MosFile::~MosFile(), and WXP::MosUFile::~MosUFile().
|
static |
Comparison routine for matching WMO headers
pattern | Pattern to match against current WMO and AWIP headers |
References WXP::StrLib::equal(), WXP::Const::MISS, and WXP::Wxp::outDebug().
const char * WmoParse::getAwip | ( | ) |
Gets the latest AWIP header
const char * WmoParse::getHeader | ( | ) |
Gets the latest matching WMO header
Referenced by WXP::MosFile::getWmo(), WXP::MosUFile::getWmo(), and WXP::WarnFile::read().
int WmoParse::getHeaderLoc | ( | ) |
Gets the location of the current header line in the file (byte offset)
int WmoParse::getLine | ( | char * | line, |
int | len | ||
) |
Gets the next matching line in the file
line | String to put data |
len | Length of string |
References WXP::StrLib::check(), WXP::StrLib::contains(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::File::getLine(), WXP::StrLib::isAlphaNum(), WXP::Wxp::outDebug(), WXP::File::seek(), WXP::File::tell(), WXP::StrLib::trimWS(), and WXP::StrLib::valid().
Referenced by getLine(), WXP::MosFile::read(), WXP::MosUFile::read(), and WXP::WarnFile::read().
int WmoParse::getLine | ( | String & | string | ) |
int WmoParse::getLoc | ( | ) |
Gets the location of the current line in the file (byte offset)
Referenced by WXP::MosUFile::read().
int WmoParse::init | ( | ) |
Initializes class values
Referenced by WmoParse(), and WmoParse().
bool WmoParse::isData | ( | ) |
Returns if the data output is valid data
bool WmoParse::isNewProd | ( | ) |
Is data part of a new product.
Referenced by WXP::MosUFile::read(), and WXP::WarnFile::read().
bool WmoParse::isOpen | ( | ) |
Is file open
Referenced by WXP::WarnFile::isOpen(), WXP::WarnFile::open(), WXP::MosFile::open(), WXP::MosUFile::open(), WXP::WarnFile::open(), and WXP::MosFile::open().
int WmoParse::open | ( | Filename & | rfilename | ) |
Opens a file to parse
rfilename | Filename to open along with header file. |
References WXP::Filename::getHeader(), WXP::Filename::getName(), WXP::Filename::getNumFiles(), WXP::File::isOpen(), WXP::File::open(), WXP::Wxp::outDebug(), WXP::Filename::setFile(), and WXP::StrLib::valid().
Referenced by WXP::WarnFile::open(), WXP::MosFile::open(), WXP::MosUFile::open(), WXP::WarnFile::open(), and WXP::MosFile::open().
int WmoParse::rewind | ( | ) |
Rewind the file
References WXP::File::rewind().
Referenced by WXP::MosFile::rewind(), and WXP::MosUFile::rewind().
int WmoParse::setHeader | ( | const char * | str | ) |
Sets the WMO header to search for
str | Header string |
References WXP::StrLib::copy().
Referenced by WXP::MosFile::setModel(), and WXP::MosUFile::setModel().
int WmoParse::setId | ( | const char * | str | ) |
Sets the string identifier to search for within product
str | Id string to search for |
References WXP::StrLib::copy().
int WmoParse::setLoc | ( | int | byte | ) |
Sets a new location in the file to start searching for data
byte | Byte offset into file |
References WXP::File::getLine(), WXP::File::rewind(), WXP::File::seek(), and WXP::File::tell().
|
inline |
Determines if header file is to be used in parsing
val | True if header file is to be used. |