WXP::Filename Class Reference

This class creates filenames. More...

#include "../include/Filename.h"

List of all members.

Public Member Functions

int initParam ()
int init ()
 Filename (const char *nameconv, const char *str)
 Filename (const char *nameconv, Date &rdate)
 Filename (const char *filename)
 Filename ()
 ~Filename ()
int set (const char *nameconv, const char *str)
int set (const char *nameconv, Date &rdate)
int set (const char *filename)
bool isSet ()
int setNameConv (const char *nameconv)
int setPath (const char *path)
int setDate (Date &rdate)
int setDate (Date &rdate, const char *param)
int getDate (Date &rdate)
DateVal getDateval ()
int getOffset ()
int setFixDate (DateVal &rdate)
int setFixDate (const char *str)
int setType (const char *rtype)
const char * getType ()
int setKey (char ch, const char *str)
const char * getExt ()
const char * getKey (char ch)
int setName (const char *rname)
const char * getName ()
int setHeader (const char *rname)
const char * getHeader ()
bool validHeader ()
bool isFixed ()
int setNumFiles (int val)
int setNumFiles (const char *str)
int getNumFiles ()
int getNumType ()
int setOutput (bool val)
int setLateLimit (int val)
int setLateDate (Date rdate)
int setBaseDate (Date &rdate)
int checkFile (const char *file)
int setFile (const char *file)
int setFilePrompt (const char *prompt)
bool exist ()
int setFile (int ind)
int listFile ()
int print ()
int printConv ()

Static Public Attributes

static const int UNK = 0
static const int HOURS = 1
static const int FILES = 2

Detailed Description

This class creates filenames.

Author:
Dan Vietor

Constructor & Destructor Documentation

Filename::Filename ( const char *  nameconv,
const char *  str 
)

Constructor. Sets the filenames given a name convention and file parameter string

Parameters:
nameconv Name convention tag
str File parameter string such as "la" for latest or time number.

References init().

Filename::Filename ( const char *  nameconv,
Date rdate 
)

Constructor. Sets the filename given and name convention and date

Parameters:
nameconv Name convention string to use
rdate Date values to set filename with

References init().

Filename::Filename ( const char *  filename  ) 

Constructor. Sets a specific filename to be used.

Parameters:
filename The filename to use

References init().

Filename::Filename (  ) 

Constructor. Initializes class data

References init().

Filename::~Filename (  ) 

Destructor.


Member Function Documentation

int Filename::checkFile ( const char *  file  ) 
int Filename::getDate ( Date rdate  ) 

Gets the current date used in the filename

Return values:
rdate The output date class

Referenced by WXP::UpaDecode::decode(), WXP::RcmDecode::decode(), WXP::RcmPlot::draw(), WXP::MeteoPlot::draw(), WXP::MdrPlot::draw(), WXP::LightPlot::draw(), WXP::GridPlot::draw(), WXP::FrontPlot::draw(), WXP::WatchPlot::getDate(), WXP::UpaXSectPlot::getDate(), WXP::UpaXSectCont::getDate(), WXP::UpaRaw::getDate(), WXP::UpaPlot::getDate(), WXP::ThermPlot::getDate(), WXP::SfcRaw::getDate(), WXP::SfcPlot::getDate(), WXP::SatPlot::getDate(), WXP::RedbookPlot::getDate(), WXP::RcmPlot::getDate(), WXP::RawPlot::getDate(), WXP::RawGrid::getDate(), WXP::RadPlot::getDate(), WXP::NidsPlot::getDate(), WXP::MosRaw::getDate(), WXP::MosPlot::getDate(), WXP::MiscPlot::getDate(), WXP::MeteoPlot::getDate(), WXP::MetaPlot::getDate(), WXP::MdrPlot::getDate(), WXP::LightPlot::getDate(), WXP::Lev2Plot::getDate(), WXP::ImagePlot::getDate(), WXP::HodoPlot::getDate(), WXP::GridPlot::getDate(), WXP::GridCont::getDate(), WXP::FrontPlot::getDate(), WXP::WatchPlot::getInitDate(), WXP::UpaXSectPlot::getInitDate(), WXP::UpaXSectCont::getInitDate(), WXP::UpaPlot::getInitDate(), WXP::ThermPlot::getInitDate(), WXP::SfcPlot::getInitDate(), WXP::SatPlot::getInitDate(), WXP::RedbookPlot::getInitDate(), WXP::RcmPlot::getInitDate(), WXP::RawPlot::getInitDate(), WXP::RadPlot::getInitDate(), WXP::NidsPlot::getInitDate(), WXP::MosPlot::getInitDate(), WXP::MiscPlot::getInitDate(), WXP::MeteoPlot::getInitDate(), WXP::MetaPlot::getInitDate(), WXP::MdrPlot::getInitDate(), WXP::LightPlot::getInitDate(), WXP::Lev2Plot::getInitDate(), WXP::ImagePlot::getInitDate(), WXP::HodoPlot::getInitDate(), WXP::GridPlot::getInitDate(), WXP::GridCont::getInitDate(), WXP::FrontPlot::getInitDate(), and WXP::WatchFile::open().

DateVal Filename::getDateval (  ) 

Gets the current date used in the filename

Returns:
The DateVal class with date values

References WXP::Date::get().

Referenced by WXP::GribFile::open().

const char * Filename::getHeader (  ) 

Gets the header filename

Returns:
The header filename string

References WXP::String::get().

Referenced by WXP::Parse::open(), and WXP::GribFile::open().

const char * Filename::getName (  ) 
int Filename::getNumFiles (  ) 
const char * Filename::getType (  ) 
int Filename::init (  ) 

Initializes class data

References UNK.

Referenced by Filename(), and WXP::SfcPlot::init().

int Filename::initParam (  ) 

Initializes parameters

int Filename::listFile (  ) 
int Filename::print (  ) 
int Filename::set ( const char *  filename  ) 

Sets a specific filename to use

Parameters:
filename The file name

References WXP::String::set().

int Filename::set ( const char *  nameconv,
Date rdate 
)

Sets the filename given and name convention and date

Parameters:
nameconv Name convention string to use
rdate Date values to set filename with

References WXP::StrLib::copy(), WXP::Date::fix(), WXP::NameConvFile::getDate(), WXP::NameConvFile::getFilename(), WXP::NameConvFile::getHdrFilename(), WXP::NameConv::getOffset(), WXP::String::set(), WXP::NameConv::set(), and WXP::NameConv::setFile().

int Filename::set ( const char *  nameconv,
const char *  str 
)

Sets the filenames given a name convention and file parameter string

Parameters:
nameconv Name convention tag
str File parameter string such as "la" for latest or time number.

References WXP::StrLib::copy(), WXP::FileTool::exist(), WXP::Date::fix(), WXP::String::get(), WXP::NameConvFile::getDate(), WXP::NameConvFile::getFilename(), WXP::NameConvFile::getHdrFilename(), WXP::NameConv::getOffset(), WXP::String::set(), WXP::NameConv::set(), and WXP::NameConv::setLatest().

Referenced by WXP::MiscPlot::setFile(), and WXP::MetaPlot::setFile().

int Filename::setBaseDate ( Date rdate  ) 

Sets the name convention base date

Return values:
rdate Output date class

References WXP::Date::fix().

int Filename::setDate ( Date rdate  ) 
int Filename::setFile ( int  ind  ) 

Sets the filename based on an offset from current time. This is meant for series of files.

Parameters:
ind Index multiplied by the time offset.
Returns:
1=within number of files, 0=beyond number of files

References WXP::Date::addSeconds(), FILES, WXP::NameConvFile::getDate(), WXP::NameConvFile::getFilename(), WXP::NameConvFile::getHdrFilename(), WXP::NameConv::getOffset(), WXP::Strings::getString(), WXP::String::set(), and WXP::NameConv::setFile().

int Filename::setFile ( const char *  filename  ) 

Sets the filename by querying a set of resources

Parameters:
filename Optional filename

References checkFile(), WXP::Strings::equal(), FILES, WXP::Date::fix(), WXP::NameConvFile::getDate(), WXP::NameConvFile::getFilename(), WXP::NameConvFile::getHdrFilename(), WXP::Strings::getNum(), WXP::Strings::getString(), WXP::StrLib::index(), WXP::String::set(), WXP::Strings::set(), WXP::NameConv::setLatest(), setNumFiles(), and WXP::StrLib::valid().

Referenced by WXP::UpaRaw::compute(), WXP::SfcRaw::compute(), WXP::MosRaw::compute(), WXP::UpaDecode::decode(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaPlot::draw(), WXP::ThermPlot::draw(), WXP::SfcPlot::draw(), WXP::SatPlot::draw(), WXP::RedbookPlot::draw(), WXP::RcmPlot::draw(), WXP::RawPlot::draw(), WXP::RadPlot::draw(), WXP::NidsPlot::draw(), WXP::MosPlot::draw(), WXP::MdrPlot::draw(), WXP::LightPlot::draw(), WXP::Lev2Plot::draw(), WXP::ImagePlot::draw(), WXP::GridPlot::draw(), WXP::GridCont::draw(), WXP::FrontPlot::draw(), WXP::GridPlot::getDomain(), WXP::GridCont::getDomain(), WXP::WatchPlot::getInitDate(), WXP::UpaXSectPlot::getInitDate(), WXP::UpaXSectCont::getInitDate(), WXP::UpaPlot::getInitDate(), WXP::ThermPlot::getInitDate(), WXP::SfcPlot::getInitDate(), WXP::SatPlot::getInitDate(), WXP::RedbookPlot::getInitDate(), WXP::RcmPlot::getInitDate(), WXP::RawPlot::getInitDate(), WXP::RadPlot::getInitDate(), WXP::NidsPlot::getInitDate(), WXP::MosPlot::getInitDate(), WXP::MiscPlot::getInitDate(), WXP::MeteoPlot::getInitDate(), WXP::MetaPlot::getInitDate(), WXP::MdrPlot::getInitDate(), WXP::LightPlot::getInitDate(), WXP::Lev2Plot::getInitDate(), WXP::ImagePlot::getInitDate(), WXP::HodoPlot::getInitDate(), WXP::GridPlot::getInitDate(), WXP::GridCont::getInitDate(), WXP::FrontPlot::getInitDate(), WXP::Parse::open(), WXP::WatchPlot::setFilename(), WXP::UpaXSectPlot::setFilename(), WXP::UpaXSectCont::setFilename(), WXP::UpaPlot::setFilename(), WXP::ThermPlot::setFilename(), WXP::SfcPlot::setFilename(), WXP::SatPlot::setFilename(), WXP::RedbookPlot::setFilename(), WXP::RcmPlot::setFilename(), WXP::RawPlot::setFilename(), WXP::RadPlot::setFilename(), WXP::NidsPlot::setFilename(), WXP::MosPlot::setFilename(), WXP::MiscPlot::setFilename(), WXP::MeteoPlot::setFilename(), WXP::MetaPlot::setFilename(), WXP::MdrPlot::setFilename(), WXP::LightPlot::setFilename(), WXP::Lev2Plot::setFilename(), WXP::ImagePlot::setFilename(), WXP::HodoPlot::setFilename(), WXP::GridPlot::setFilename(), WXP::GridCont::setFilename(), and WXP::FrontPlot::setFilename().

int Filename::setFilePrompt ( const char *  prompt  ) 
int Filename::setFixDate ( const char *  str  ) 

Sets the set date used to determine files. Parameters in date fix those values in filename. Default is undefined.

Parameters:
str Set date for files

References WXP::NameConv::setFixDate().

int Filename::setFixDate ( DateVal rdate  ) 

Sets the set date used to determine files. Parameters in date fix those values in filename. Default is undefined.

Parameters:
rdate Set date for files

References WXP::NameConv::setFixDate().

Referenced by WXP::UpaDecode::setHour(), and WXP::SfcPlot::setHour().

int Filename::setHeader ( const char *  rname  ) 

Sets the header filename

Parameters:
rname The heade file name

References WXP::String::set().

int Filename::setLateDate ( Date  rdate  ) 

Sets the base date used to determine latest files. Default is current time.

Parameters:
rdate Base date for latest files

References WXP::NameConv::setLateDate().

int Filename::setLateLimit ( int  val  ) 

Sets the number of times to look back to find the latest file.

Parameters:
val The number of offset times.

References WXP::NameConv::setLateLimit().

int Filename::setName ( const char *  rname  ) 

Sets the specific filename

Parameters:
rname The file name

References WXP::String::set().

int Filename::setNameConv ( const char *  nameconv  ) 
int Filename::setNumFiles ( const char *  str  ) 

Sets the number of files in a series

Parameters:
str String containing series parameters

References WXP::NameConv::getOffset(), WXP::Const::MISS, WXP::Wxp::outDebug(), and WXP::StrLib::valid().

int Filename::setNumFiles ( int  val  ) 
int Filename::setOutput ( bool  val  ) 

Sets whether the file is an output file or not. If output, cannot search for latest file.

Parameters:
val Whether output file

References WXP::NameConv::setOutput().

int Filename::setPath ( const char *  str  ) 

Sets the file path

Parameters:
str User defined file path

References WXP::NameConv::setPath().

Referenced by WXP::SfcPlot::setPath(), WXP::NidsPlot::setPath(), and WXP::LightPlot::setPath().

int Filename::setType ( const char *  rtype  ) 

Sets the file type parameter

Parameters:
rtype File type

References WXP::StrLib::copy().

Referenced by WXP::ImagePlot::setFile(), WXP::SatPlot::setInput(), and WXP::ImagePlot::setInput().

bool Filename::validHeader (  ) 

Returns if the header filename has a valid string in it.

Returns:
True if header filename valid

References WXP::String::valid().

Referenced by WXP::GribFile::open().


Member Data Documentation

const int WXP::Filename::FILES = 2 [static]

Multiple files by list of files

Referenced by WXP::SatPlot::draw(), print(), setFile(), and setFilePrompt().

const int WXP::Filename::HOURS = 1 [static]

Multiple files by time

Referenced by print().

const int WXP::Filename::UNK = 0 [static]

Multiple files by time

Referenced by init().


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