WXP::NameConv Class Reference

This class creates a name convention used to create filenames. More...

#include "../include/NameConv.h"

List of all members.

Public Types

enum  Type { FILENAME, HEADER }

Public Member Functions

 NameConv (const char *type)
 NameConv ()
 ~NameConv ()
int initParam ()
int init ()
int set (const char *type)
int setOutput (bool val)
int setFixDate (const char *str)
int setFixDate (DateVal &rdate)
int getFixDate (DateVal &rdate)
int setLateLimit (int val)
int setLateDate (Date rdate)
int setOffset (int val)
int getOffset ()
int getMinSize ()
int getMinTime ()
const char * getType ()
const char * getFile ()
int setExt (const char *str)
const char * getExt ()
int setKey (char ch, const char *str)
const char * getKey (char ch)
int setPath (const char *path)
int setPath (String &path)
const char * getPath ()
int getNumPath ()
int setPathNum (int ind)
int encode (Date &rdate, int flag, String &filename)
int encodeFile (Date &rdate, String &filename)
int encodeHdr (Date &rdate, String &filename)
int decode (const char *filename)
int setLatest (const char *str, NameConvFile &file)
int setFile (Date &rdate, NameConvFile &file)
int getDate (Date &rdate)
int print ()

Static Public Member Functions

static int setOffset (const char *file)

Detailed Description

This class creates a name convention used to create filenames.

Author:
Dan Vietor

Member Enumeration Documentation

Enumerator:
FILENAME 

Regular filename

HEADER 

Header filename


Constructor & Destructor Documentation

NameConv::NameConv ( const char *  rtype  ) 

Constructor. Sets name convention tag

Parameters:
type Name convention tag

References initParam().

NameConv::NameConv (  ) 

Constructor. Initializes class values

References init(), and initParam().

NameConv::~NameConv (  ) 

Destructor.


Member Function Documentation

int NameConv::decode ( const char *  filename  ) 
int NameConv::encode ( Date rdate,
int  flag,
String filename 
)
int NameConv::encodeFile ( Date rdate,
String filename 
)

Encodes a filename from the name convention

Parameters:
rdate Date to use in encoding filename
Return values:
filename String containing filename

References encode(), and FILENAME.

int NameConv::encodeHdr ( Date rdate,
String filename 
)

Encodes a header filename from the name convention

Parameters:
rdate Date to use in encoding filename
Return values:
filename String containing filename

References encode(), and HEADER.

int NameConv::getDate ( Date rdate  ) 

Gets the date value

Return values:
rdate The base date for sets of files.

Referenced by WXP::Filename::checkFile().

const char * NameConv::getExt (  ) 

Gets the file name convention extension string (past last _)

Returns:
Extension string

Referenced by WXP::Filename::listFile().

const char * NameConv::getFile (  ) 

Gets the file name convention string.

Returns:
File name convention string

Referenced by WXP::Filename::checkFile(), and WXP::Filename::listFile().

const char * NameConv::getKey ( char  ch  ) 

Gets the key string.

Parameters:
ch Key to get
Returns:
String associated with the key.

Referenced by WXP::Filename::listFile().

int WXP::NameConv::getMinSize (  )  [inline]

Returns the min size of file used in latest

int WXP::NameConv::getMinTime (  )  [inline]

Returns the min time of file used in latest

int WXP::NameConv::getOffset (  )  [inline]
const char * NameConv::getPath (  ) 

Gets the file path as extracted from the name convention

Returns:
Extension string

References WXP::String::get().

Referenced by encode().

int NameConv::init (  ) 

Initializes the class data

References WXP::Const::MISS.

Referenced by NameConv(), and set().

int NameConv::initParam (  ) 

Initializes just the

References WXP::String::clear().

Referenced by NameConv().

int NameConv::set ( const char *  rtype  ) 
int NameConv::setExt ( const char *  str  ) 

Sets the file name convention extension string (past last _)

Returns:
Extension string

References WXP::StrLib::copy().

int NameConv::setFile ( Date rdate,
NameConvFile file 
)

Sets the filename given the name convention and date

Parameters:
rdate The date to use in encoding the filename
Return values:
file The NameConvFile class containing filename information

References encode(), FILENAME, WXP::String::get(), WXP::FileTool::getSize(), HEADER, WXP::Wxp::outDebug(), WXP::NameConvFile::setDate(), WXP::NameConvFile::setFilename(), WXP::NameConvFile::setHdrFilename(), WXP::NameConvFile::setOffset(), and WXP::NameConvFile::setType().

Referenced by WXP::Filename::checkFile(), WXP::Filename::set(), WXP::Filename::setDate(), and WXP::Filename::setFile().

int NameConv::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
int NameConv::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 String specifying values

References WXP::DateVal::day, WXP::DateVal::hour, WXP::DateVal::min, WXP::DateVal::month, WXP::StrLib::valid(), and WXP::DateVal::year.

Referenced by WXP::Filename::setFixDate().

int NameConv::setKey ( char  ch,
const char *  str 
)

Sets the key string.

Parameters:
ch Key to set
str String associated with the key.

References WXP::StrLib::copy().

Referenced by decode().

int NameConv::setLateDate ( Date  rdate  ) 

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

Parameters:
rdate Base date for latest files

Referenced by WXP::Filename::setLateDate().

int NameConv::setLateLimit ( int  val  ) 

Sets the number of files back to search for latest available

Parameters:
val Number of files to search through

Referenced by WXP::Filename::setLateLimit().

int NameConv::setLatest ( const char *  str,
NameConvFile file 
)
int NameConv::setOffset ( const char *  file  )  [static]

Sets the time offset value between file times in seconds

Parameters:
file Name convention string to extract offset

References WXP::Const::MISS.

int WXP::NameConv::setOffset ( int  val  )  [inline]

Sets the time offset between file times

Referenced by set().

int NameConv::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

Referenced by WXP::Filename::setOutput().

int NameConv::setPath ( const char *  str  ) 

Sets the path

Parameters:
str Path string

References WXP::StrLib::equal(), and WXP::String::set().

Referenced by WXP::Filename::setPath().


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