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

This class creates filenames. More...

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

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 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 setForeTime (int time)
 
int getForeTime ()
 
int setKey (char ch, const char *str)
 
const char * getExt ()
 
const char * getKey (char ch)
 
int setName (const char *rname)
 
const char * getName ()
 
const char * getName (int ind)
 
int setHeader (const char *rname)
 
const char * getHeader ()
 
bool validHeader ()
 
int addOutPath (const char *path)
 
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 (Date &rdate)
 
int setFile (Date &rdate, const char *param)
 
int setFile (const char *file)
 
int setFile ()
 
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() [1/4]

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

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

Parameters
nameconvName convention tag
strFile parameter string such as "la" for latest or time number.

References init(), and set().

◆ Filename() [2/4]

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

Constructor. Sets the filename given and name convention and date

Parameters
nameconvName convention string to use
rdateDate values to set filename with

References init(), and set().

◆ Filename() [3/4]

Filename::Filename ( const char *  filename)

Constructor. Sets a specific filename to be used.

Parameters
filenameThe filename to use

References init(), and set().

◆ Filename() [4/4]

Filename::Filename ( )

Constructor. Initializes class data

References init().

◆ ~Filename()

Filename::~Filename ( )

Destructor.

Member Function Documentation

◆ checkFile()

int Filename::checkFile ( const char *  file)

◆ getDate()

int Filename::getDate ( Date rdate)

Gets the current date used in the filename

Return values
rdateThe output date class

Referenced by WXP::RcmDecode::decode(), WXP::UpaDecode::decode(), WXP::FrontPlot::draw(), WXP::GridCont::draw(), WXP::GridPlot::draw(), WXP::HurPlot::draw(), WXP::LightPlot::draw(), WXP::MdrPlot::draw(), WXP::MeteoPlot::draw(), WXP::RcmPlot::draw(), WXP::WarnPlot::draw(), WXP::FrontPlot::getDate(), WXP::GridCont::getDate(), WXP::GridPlot::getDate(), WXP::GridVect::getDate(), WXP::HodoPlot::getDate(), WXP::HurPlot::getDate(), WXP::ImagePlot::getDate(), WXP::Lev2Plot::getDate(), WXP::LightPlot::getDate(), WXP::MdrPlot::getDate(), WXP::MetaPlot::getDate(), WXP::MeteoPlot::getDate(), WXP::MiscPlot::getDate(), WXP::MosPlot::getDate(), WXP::MosRaw::getDate(), WXP::NidsPlot::getDate(), WXP::ProfPlot::getDate(), WXP::RadPlot::getDate(), WXP::RawGrid::getDate(), WXP::RawPlot::getDate(), WXP::RcmPlot::getDate(), WXP::RedbookPlot::getDate(), WXP::SatPlot::getDate(), WXP::SfcPlot::getDate(), WXP::SfcRaw::getDate(), WXP::SoundPlot::getDate(), WXP::UpaPlot::getDate(), WXP::UpaRaw::getDate(), WXP::UpaXSectCont::getDate(), WXP::UpaXSectPlot::getDate(), WXP::WarnPlot::getDate(), WXP::WatchPlot::getDate(), WXP::RadMask::getGrids(), WXP::FrontPlot::getInitDate(), WXP::GridCont::getInitDate(), WXP::GridPlot::getInitDate(), WXP::GridVect::getInitDate(), WXP::HodoPlot::getInitDate(), WXP::HurPlot::getInitDate(), WXP::ImagePlot::getInitDate(), WXP::Lev2Plot::getInitDate(), WXP::LightPlot::getInitDate(), WXP::MdrPlot::getInitDate(), WXP::MetaPlot::getInitDate(), WXP::MeteoPlot::getInitDate(), WXP::MiscPlot::getInitDate(), WXP::MosPlot::getInitDate(), WXP::NidsPlot::getInitDate(), WXP::ProfPlot::getInitDate(), WXP::RadPlot::getInitDate(), WXP::RawPlot::getInitDate(), WXP::RcmPlot::getInitDate(), WXP::RedbookPlot::getInitDate(), WXP::SatPlot::getInitDate(), WXP::SfcPlot::getInitDate(), WXP::SoundPlot::getInitDate(), WXP::UpaPlot::getInitDate(), WXP::UpaXSectCont::getInitDate(), WXP::UpaXSectPlot::getInitDate(), WXP::WarnPlot::getInitDate(), WXP::WatchPlot::getInitDate(), WXP::ProfFile::open(), WXP::WarnFile::open(), WXP::WatchFile::open(), WXP::MosFile::open(), and WXP::MdrImage::readFile().

◆ getDateval()

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::HurPlot::draw(), WXP::WarnPlot::draw(), and WXP::GribFile::open().

◆ getHeader()

const char * Filename::getHeader ( )

Gets the header filename

Returns
The header filename string

References WXP::String::get().

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

◆ getName() [1/2]

const char * Filename::getName ( )

Gets the filename

Returns
The file name string

References WXP::String::get().

Referenced by WXP::MosRaw::compute(), WXP::SfcRaw::compute(), WXP::UpaRaw::compute(), WXP::RcmDecode::decode(), WXP::UpaDecode::decode(), WXP::RcmDecode::decode(), WXP::UpaDecode::decode(), WXP::FrontPlot::draw(), WXP::GridCont::draw(), WXP::GridPlot::draw(), WXP::GridVect::draw(), WXP::HodoPlot::draw(), WXP::HurPlot::draw(), WXP::ImagePlot::draw(), WXP::Lev2Plot::draw(), WXP::LightPlot::draw(), WXP::MdrPlot::draw(), WXP::MetaPlot::draw(), WXP::MiscPlot::draw(), WXP::MosPlot::draw(), WXP::NidsPlot::draw(), WXP::ProfPlot::draw(), WXP::RadPlot::draw(), WXP::RawPlot::draw(), WXP::RcmPlot::draw(), WXP::RedbookPlot::draw(), WXP::SatPlot::draw(), WXP::SfcPlot::draw(), WXP::SoundPlot::draw(), WXP::UpaPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::WarnPlot::draw(), WXP::GridCont::getDomain(), WXP::GridPlot::getDomain(), WXP::GridVect::getDomain(), WXP::ImagePlot::getDomain(), WXP::Lev2Plot::getDomain(), WXP::NidsPlot::getDomain(), WXP::SatPlot::getDomain(), WXP::RedbookPlot::getDomain(), WXP::RadMask::getGrids(), WXP::RadMask::getGrids(), WXP::GribFile::open(), WXP::MetarFile::open(), WXP::Parse::open(), WXP::ProfFile::open(), WXP::WatchFile::open(), WXP::WmoParse::open(), WXP::GridFile::open(), WXP::FrontPlot::print(), WXP::HurPlot::print(), WXP::NidsPlot::print(), WXP::WarnPlot::print(), WXP::NidsImage::readSite(), WXP::SatFile::SatFile(), WXP::HodoPlot::setFilename(), WXP::HodoPlot::setFilename(), WXP::HodoPlot::setFilename(), WXP::HodoPlot::setFilename(), and WXP::NidsImage::setImage().

◆ getName() [2/2]

const char * Filename::getName ( int  ind)

Gets the filename from the stored filenames

Parameters
indThe index of the filename in the array
Returns
The file name string

References WXP::String::get(), and WXP::Strings::getString().

◆ getNumFiles()

int Filename::getNumFiles ( )

◆ getType()

const char * Filename::getType ( )

◆ init()

int Filename::init ( )

Initializes class data

References UNK.

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

◆ initParam()

int Filename::initParam ( )

Initializes parameters

◆ listFile()

int Filename::listFile ( )

◆ print()

int Filename::print ( )

◆ set() [1/3]

int Filename::set ( const char *  filename)

Sets a specific filename to use

Parameters
filenameThe file name

References WXP::String::set().

◆ set() [2/3]

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

Sets the filenames given a name convention and file parameter string

Parameters
nameconvName convention tag
strFile 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 Filename(), Filename(), Filename(), WXP::MetaPlot::setFile(), and WXP::MiscPlot::setFile().

◆ set() [3/3]

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

Sets the filename given and name convention and date

Parameters
nameconvName convention string to use
rdateDate 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().

◆ setBaseDate()

int Filename::setBaseDate ( Date rdate)

Sets the name convention base date

Return values
rdateOutput date class

References WXP::Date::fix().

Referenced by WXP::UpaDecode::decode().

◆ setDate()

int Filename::setDate ( Date rdate)

◆ setFile() [1/4]

int Filename::setFile ( )

◆ setFile() [2/4]

int Filename::setFile ( const char *  filename)

◆ setFile() [3/4]

int Filename::setFile ( Date rdate)

Sets the filename given a date (name convention already set).

Parameters
rdateDate values to set filename from

References WXP::FileTool::exist(), WXP::Date::fix(), WXP::String::get(), WXP::NameConvFile::getDate(), WXP::NameConvFile::getFilename(), WXP::NameConvFile::getHdrFilename(), WXP::Date::getSeconds(), WXP::Const::MISS, WXP::String::set(), and WXP::NameConv::setFile().

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

◆ setFile() [4/4]

int Filename::setFile ( int  ind)

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

Parameters
indIndex 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::Strings::getString(), WXP::String::set(), and WXP::NameConv::setFile().

◆ setFixDate() [1/2]

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
strSet date for files

References WXP::NameConv::setFixDate().

◆ setFixDate() [2/2]

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
rdateSet date for files

References WXP::NameConv::setFixDate().

Referenced by WXP::GridCont::draw(), WXP::ImagePlot::draw(), WXP::GridCont::setFilename(), WXP::HurPlot::setHour(), WXP::LightPlot::setHour(), WXP::RedbookPlot::setHour(), WXP::SfcPlot::setHour(), WXP::UpaDecode::setHour(), WXP::UpaPlot::setHour(), WXP::WarnPlot::setHour(), and WXP::WatchPlot::setHour().

◆ setHeader()

int Filename::setHeader ( const char *  rname)

Sets the header filename

Parameters
rnameThe heade file name

References WXP::String::set().

◆ setLateDate()

int Filename::setLateDate ( Date  rdate)

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

Parameters
rdateBase date for latest files

References WXP::NameConv::setLateDate().

◆ setLateLimit()

int Filename::setLateLimit ( int  val)

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

Parameters
valThe number of offset times.

References WXP::NameConv::setLateLimit().

◆ setName()

int Filename::setName ( const char *  rname)

Sets the specific filename

Parameters
rnameThe file name

References WXP::String::set().

Referenced by WXP::GridVect::draw().

◆ setNameConv()

int Filename::setNameConv ( const char *  nameconv)

◆ setNumFiles() [1/2]

int Filename::setNumFiles ( const char *  str)

Sets the number of files in a series

Parameters
strString containing series parameters

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

◆ setNumFiles() [2/2]

int Filename::setNumFiles ( int  val)

◆ setOutput()

int Filename::setOutput ( bool  val)

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

Parameters
valWhether output file

References WXP::NameConv::setOutput().

◆ setPath()

int Filename::setPath ( const char *  str)

Sets the file path

Parameters
strUser defined file path

References WXP::NameConv::setPath().

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

◆ setType()

int Filename::setType ( const char *  rtype)

Sets the file type parameter

Parameters
rtypeFile type

References WXP::StrLib::copy().

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

◆ validHeader()

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

◆ FILES

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

Multiple files by list of files

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

◆ HOURS

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

Multiple files by time

Referenced by print().

◆ UNK

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: