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

This class processes variable information from variable.lup file. More...

#include "../include/VarName.h"

Public Member Functions

 VarName ()
 
int init ()
 
int get (int rind, String &str)
 
int get (int rind, Variable &var)
 
int get (const char *str, Variable &var)
 
int get (Variable &var)
 
int get (const char *str, VarNameItem &var)
 
int get (int rind, VarNameItem &var)
 
const char * get (int rind)
 
const char * getAbbr (int rind)
 
int get (const char *str)
 
int searchFile (int rind, const char *str)
 

Static Public Member Functions

static VarNameItem searchFile (const char *var)
 
static int makeLabel (const char *var, const char *units, String &fullname)
 

Static Public Attributes

static const int max_vname = 40
 

Detailed Description

This class processes variable information from variable.lup file.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ VarName()

VarName::VarName ( )

Constructor. Initializes class values

References init().

Member Function Documentation

◆ get() [1/8]

int VarName::get ( const char *  str)

Gets the variable index

Parameters
strVariable abbreviation

References WXP::StrLib::iequal(), WXP::Const::MISS, and searchFile().

◆ get() [2/8]

int VarName::get ( const char *  str,
Variable var 
)

Gets the variable information from abbreviation

Parameters
strVariable abbreviation
Return values
varVariable information

References WXP::StrLib::equal(), WXP::Const::MISS, searchFile(), WXP::Variable::setAbbr(), WXP::Variable::setInd(), and WXP::Variable::setName().

◆ get() [3/8]

int VarName::get ( const char *  str,
VarNameItem var 
)

Gets the variable information from abbreviation

Parameters
strVariable abbreviation
Return values
varVariable information

References WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::StrLib::index(), WXP::VarNameItem::init(), WXP::Const::MISS, and searchFile().

◆ get() [4/8]

const char * VarName::get ( int  rind)

Gets the variable abbreviation from index

Parameters
rindIndex
Returns
Output abbreviation

References searchFile().

◆ get() [5/8]

int VarName::get ( int  rind,
String str 
)

Gets the variable abbreviation from index

Parameters
rindIndex
Return values
strOutput abbreviation

References get(), WXP::String::length(), and WXP::String::set().

Referenced by WXP::GridPlot::draw(), WXP::VectPlot::drawLabels(), and get().

◆ get() [6/8]

int VarName::get ( int  rind,
Variable var 
)

Gets the variable information from index

Parameters
rindIndex
Return values
varOutput variable information

References WXP::Variable::init(), searchFile(), WXP::Variable::setAbbr(), WXP::Variable::setInd(), and WXP::Variable::setName().

◆ get() [7/8]

int VarName::get ( int  rind,
VarNameItem var 
)

Gets the variable information from index

Parameters
rindIndex
Return values
varOutput variable information

References WXP::VarNameItem::init(), and searchFile().

◆ get() [8/8]

int VarName::get ( Variable var)

Gets the variable index and name given abbreviation

Return values
varVariable information, uses abbreviation in var and sets rest

References WXP::Variable::getAbbr(), WXP::Const::MISS, searchFile(), WXP::Variable::setInd(), and WXP::Variable::setName().

◆ getAbbr()

const char * VarName::getAbbr ( int  rind)

Returns the variable abbreviation

Parameters
rindIndex
Returns
Variable abbreviation

References searchFile().

◆ init()

int VarName::init ( )

Initializes class values

Referenced by VarName().

◆ makeLabel()

int VarName::makeLabel ( const char *  var,
const char *  units,
String fullname 
)
static

Makes a simple label

Parameters
varVariable abbrievation
unitsUnits string
Return values
fullnameOutput full name with units

References WXP::String::append(), searchFile(), and WXP::String::set().

Referenced by WXP::ProfPlot::draw(), WXP::UpaXSectCont::draw(), and WXP::UpaXSectPlot::draw().

◆ searchFile() [1/2]

VarNameItem VarName::searchFile ( const char *  var)
static

◆ searchFile() [2/2]

int VarName::searchFile ( int  rind,
const char *  str 
)

Searchs the variable.lup file for variable information. Uses abbreviation and then index

Parameters
rindIndex
strAbbreviation
Returns
Index or -1 for not found

References WXP::FileTool::addPath(), WXP::StrLib::equal(), WXP::String::get(), WXP::Wxp::getDatabasePath(), WXP::File::getLine(), WXP::VarNameItem::init(), WXP::File::isOpen(), WXP::Const::MISS, WXP::Wxp::outWarning(), WXP::StrLib::trimWS(), and WXP::StrLib::valid().

Referenced by get(), getAbbr(), and makeLabel().


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