WXP::Parse Class Reference

This class parses text files. More...

#include "../include/Parse.h"

List of all members.

Public Types

enum  Type { RAW, WXP }

Public Member Functions

 Parse ()
 Parse (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 getLine (char *string, int len)
int getLine (String &line)
bool isData ()

Static Public Member Functions

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

Parse::Parse (  ) 

Constructor. Initializes class values

References init().


Member Function Documentation

int Parse::close (  ) 
bool Parse::compare ( const char *  header,
const char *  header2,
const char *  pattern 
) [static]

Comparison routine for matching WMO headers

Parameters:
pattern Pattern to match against current WMO and AWIP headers

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

const char * Parse::getAwip (  ) 

Gets the latest AWIP header

Returns:
AWIP header
const char * Parse::getHeader (  ) 

Gets the latest matching WMO header

Returns:
WMO header string
int Parse::getHeaderLoc (  ) 

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

Returns:
The byte offset into file
int Parse::getLine ( String string  ) 

Gets the next matching line in the file

Return values:
string String class to put data

References getLine().

int Parse::getLine ( char *  line,
int  len 
)
int Parse::getLoc (  ) 

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

Returns:
The byte offset into file

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

int Parse::init (  ) 

Initializes class values

Referenced by Parse().

bool Parse::isData (  ) 

Returns if the data output is valid data

Returns:
True if valid data
bool Parse::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().

bool Parse::isOpen (  ) 

Is file open

Returns:
True if file open

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

int Parse::open ( Filename rfilename  ) 
int Parse::rewind (  ) 

Rewind the file

References WXP::File::rewind().

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

int Parse::setHeader ( const char *  str  ) 

Sets the WMO header to search for

Parameters:
str Header string

References WXP::StrLib::copy().

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

int Parse::setId ( const char *  str  ) 

Sets the string identifier to search for within product

Parameters:
str Id string to search for

References WXP::StrLib::copy().

int Parse::setLoc ( int  byte  ) 

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

Parameters:
byte Byte offset into file

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

int WXP::Parse::useHdrFile ( bool  val  )  [inline]

Determines if header file is to be used in parsing

Parameters:
val True if header file is to be used.

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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1