WXP::SfcXmlFile Class Reference

This class reads in surface data from a WXP formatted file from file. More...

#include "../include/SfcXmlFile.h"

List of all members.

Public Types

enum  { UNK, NORM, COMPRESS }

Public Member Functions

 SfcXmlFile ()
 SfcXmlFile (const char *filename)
 SfcXmlFile (const char *filename, int access)
 SfcXmlFile (const char *filename, int access, int rtype)
 ~SfcXmlFile ()
bool isOpen ()
int open (const char *filename, int access, int rtype)
int rewind ()
int close ()
int setDate (Date &rdate)
int getDate (Date &rdate)
int read (SfcData &data)
int write (SfcData &data)

Static Public Member Functions

static int checkType (const char *filename)

Detailed Description

This class reads in surface data from a WXP formatted file from file.

Author:
Dan Vietor

Constructor & Destructor Documentation

SfcXmlFile::SfcXmlFile (  ) 

Constructor

SfcXmlFile::SfcXmlFile ( const char *  filename  ) 

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

Parameters:
filename File to open

References open(), and WXP::FileAttr::READ.

SfcXmlFile::SfcXmlFile ( const char *  filename,
int  raccess 
)

Constructor. Opens the surface data file

Parameters:
filename File to open
raccess Access type (FileAttr::READ, FileAttr::WRITE, FileAttr::APPEND)

References open().

SfcXmlFile::SfcXmlFile ( const char *  filename,
int  raccess,
int  rtype 
)

Constructor. Opens the surface data file

Parameters:
filename File to open
raccess Access type (FileAttr::READ, FileAttr::WRITE, FileAttr::APPEND)
rtype File type (NORMAL, COMPRESS)

References open().

SfcXmlFile::~SfcXmlFile (  ) 

Destructor

References close().


Member Function Documentation

int SfcXmlFile::checkType ( const char *  filename  )  [static]

Checks the type of data in the file

Parameters:
filename File to check

References WXP::File::isOpen(), and WXP::File::scanf().

Referenced by open().

int SfcXmlFile::close (  ) 

Closes the surface data file

References WXP::FileAttr::WRITE.

Referenced by WXP::SfcFile::close(), and ~SfcXmlFile().

int SfcXmlFile::getDate ( Date rdate  ) 

Gets the date of the file

Return values:
rdate Date class to put date information

Referenced by WXP::SfcFile::getDate().

int SfcXmlFile::open ( const char *  filename,
int  raccess,
int  rtype 
)

Opens the surface data file

Parameters:
filename File to open
raccess Access type (FileAttr::READ, FileAttr::WRITE, FileAttr::APPEND)
rtype File type (NORMAL, COMPRESS)

References checkType(), WXP::DateTool::createLabel(), WXP::DateTool::decode(), WXP::StrLib::equal(), WXP::String::get(), WXP::FileAttr::READ, and WXP::FileAttr::WRITE.

Referenced by WXP::SfcFile::open(), and SfcXmlFile().

int SfcXmlFile::read ( SfcData data  ) 

Reads a single report/station from the data file

Return values:
data SfcData class to put the data from the file

References WXP::Date::adjustMinute(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::Convert::FtoC(), and WXP::SfcData::init().

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

int SfcXmlFile::rewind (  ) 

Rewinds the surface data file

References WXP::FileAttr::READ.

int SfcXmlFile::setDate ( Date rdate  ) 

Sets the date of the file

Return values:
rdate Date class containing date information

Referenced by WXP::SfcFile::setDate().


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