WXP C++ Library Version 6.74.9
|
This class creates a list of strings. More...
#include "../include/Strings.h"
Public Member Functions | |
Strings () | |
Strings (int num) | |
Strings (const char *string, char delim, int num) | |
Strings (const char *string, char delim, int num, const char *groups) | |
Strings (const char *string, char delim) | |
Strings (const char *string) | |
Strings (int cnt, const char *str[]) | |
Strings (const Strings &strings) | |
Strings | operator= (const Strings &strings) |
~Strings () | |
int | init () |
int | clear () |
int | set (int num) |
int | expand (int num) |
int | add (const char *string) |
int | set (int ind, const char *string) |
int | set (const char *string, char delim, int num) |
int | set (const char *string, char delim) |
int | set (const char *string, char delim, int num, const char *groups) |
int | set (const char *string) |
int | set (int cnt, const char *str[]) |
int | set (const Strings &strings) |
int | set (const char *string, const char *pattern) |
const char * | getString (int ind) |
const char * | getString (int ind, char delim) |
const char * | getString (int ind, int off) |
const char * | getStringAfter (int ind, char ch) |
char | getChar (int ind, int off) |
bool | valid (int ind) |
bool | equal (int ind, const char *str) |
bool | equal (int ind, int off, const char *str) |
bool | equal (int ind, const char *str, int num) |
bool | iequal (int ind, const char *str) |
bool | iequal (int ind, int off, const char *str) |
bool | iequal (int ind, const char *str, int num) |
int | find (const char *str) |
int | index (int ind, char s1) |
bool | contains (int ind, const char *str) |
int | occurs (int ind, char c) |
int | getLength (int ind) |
int | scanf (int ind, const char *fmt,...) |
int | scanf (int ind, int off, const char *fmt,...) |
int | getInt (int ind) |
int | getInt (int ind, int off) |
int | getIntAfter (int ind, char ch) |
long | getLong (int ind) |
long | getLong (int ind, int off) |
long | getLongAfter (int ind, char ch) |
float | getFloat (int ind) |
float | getFloat (int ind, int off) |
float | getFloatAfter (int ind, char ch) |
bool | check (int ind, const char *pat) |
int | getNum () |
int | print () |
This class creates a list of strings.
Strings::Strings | ( | ) |
Constructor. Initializes class values
References init().
Strings::Strings | ( | int | rnum | ) |
Strings::Strings | ( | const char * | string, |
char | delim, | ||
int | rnum | ||
) |
Strings::Strings | ( | const char * | string, |
char | delim, | ||
int | rnum, | ||
const char * | groups | ||
) |
Strings::Strings | ( | const char * | string, |
char | delim | ||
) |
Strings::Strings | ( | const char * | string | ) |
Strings::Strings | ( | int | cnt, |
const char * | str[] | ||
) |
Strings::Strings | ( | const Strings & | strings | ) |
Strings::~Strings | ( | ) |
Destructor. Frees allocated strings
int Strings::add | ( | const char * | string | ) |
Sets individual items in string list (overwrites existing string)
ind | The index to put the string |
string | The string to put into list |
References WXP::StrLib::acopy(), and expand().
Referenced by WXP::WarnFile::read().
int Strings::clear | ( | ) |
Clears the strings
Referenced by WXP::WarnFile::read().
bool Strings::equal | ( | int | ind, |
const char * | str | ||
) |
Determines if string is equal to one in the list
ind | Index of string in list |
str | String to compare it to |
References WXP::StrLib::equal().
Referenced by WXP::Vtec::decode(), WXP::DomainTool::decode(), WXP::GifFile::read(), WXP::LZWComp::read(), WXP::PngFile::read(), WXP::NameConv::set(), WXP::Graph::setDevice(), WXP::Filename::setFile(), WXP::Figure::setParam(), WXP::ObjectAnal::setParam(), WXP::VectPlot::setParam(), WXP::ContPlot::setParam(), WXP::DatumPlot::setParam(), WXP::FrontPlot::setParam(), WXP::GridCont::setParam(), WXP::GridPlot::setParam(), WXP::HodoPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::LightPlot::setParam(), WXP::MapPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MosPlot::setParam(), WXP::NidsPlot::setParam(), WXP::RadPlot::setParam(), WXP::RawGrid::setParam(), WXP::RawPlot::setParam(), WXP::RcmDecode::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SoundPlot::setParam(), WXP::ThermPlot::setParam(), WXP::UpaDecode::setParam(), WXP::UpaPlot::setParam(), WXP::WarnPlot::setParam(), WXP::WatchPlot::setParam(), WXP::WmoIngest::setParam(), and WXP::XWindow::setParam().
bool Strings::equal | ( | int | ind, |
const char * | str, | ||
int | nlen | ||
) |
Determines if string is equal to one in the list
ind | Index of string in list |
str | String to compare it to |
nlen | Number of characters in string to compare |
References WXP::StrLib::equal().
bool Strings::equal | ( | int | ind, |
int | off, | ||
const char * | str | ||
) |
Determines if string is equal to one in the list
ind | Index of string in list |
off | Offset into string to start comparing |
str | String to compare it to |
References WXP::StrLib::equal().
int Strings::expand | ( | int | rmax | ) |
int Strings::find | ( | const char * | str | ) |
Finds a string in the list
str | String to compare it to |
References WXP::StrLib::equal().
char Strings::getChar | ( | int | ind, |
int | off | ||
) |
Gets the character at location off
ind | Index of string in the list |
off | Offset of character in string |
Referenced by WXP::ResrcDB::create(), WXP::MapPlot::draw(), WXP::DatumAttr::parse(), and WXP::XWindow::setParam().
float Strings::getFloat | ( | int | ind | ) |
Returns a float extracted from a string in the list
ind | Index of string |
References WXP::Const::MISS.
Referenced by WXP::ThermPlot::draw(), WXP::DatumAttr::parse(), WXP::FloatArray::set(), WXP::ObjectAnal::setParam(), WXP::FrontPlot::setParam(), WXP::HodoPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::LightPlot::setParam(), WXP::MdrPlot::setParam(), WXP::RawPlot::setParam(), WXP::RcmPlot::setParam(), WXP::SatPlot::setParam(), WXP::WarnPlot::setParam(), and WXP::WatchPlot::setParam().
float Strings::getFloat | ( | int | ind, |
int | off | ||
) |
Returns a float extracted from a string in the list
ind | Index of string |
off | Offset into string to start extracting |
References WXP::Const::MISS.
int Strings::getInt | ( | int | ind | ) |
Returns an integer extracted from a string in the list
ind | Index of string |
References WXP::Const::MISS.
Referenced by WXP::Vtec::decode(), WXP::DatumAttr::parse(), WXP::ModelSpec::set(), WXP::Message::set(), WXP::NameConv::set(), WXP::Figure::setParam(), WXP::ObjectAnal::setParam(), WXP::CityPlot::setParam(), WXP::FrontPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::LightPlot::setParam(), WXP::MdrPlot::setParam(), WXP::NidsImage::setParam(), WXP::NidsPlot::setParam(), WXP::RawGrid::setParam(), WXP::RcmDecode::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::WarnPlot::setParam(), WXP::WatchPlot::setParam(), and WXP::WmoIngest::setParam().
int Strings::getInt | ( | int | ind, |
int | off | ||
) |
Returns an integer extracted from a string in the list
ind | Index of string |
off | Offset into string to start extracting |
References WXP::Const::MISS.
int Strings::getLength | ( | int | ind | ) |
Returns the length of a string in the list
ind | Index of string in list |
Referenced by WXP::CityTool::compareData(), WXP::CityPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::MdrPlot::setParam(), WXP::NidsPlot::setParam(), WXP::RawGrid::setParam(), WXP::RcmPlot::setParam(), and WXP::XWindow::setParam().
long Strings::getLong | ( | int | ind | ) |
Returns an integer extracted from a string in the list
ind | Index of string |
References WXP::Const::MISS.
Referenced by WXP::NameConv::set().
long Strings::getLong | ( | int | ind, |
int | off | ||
) |
Returns an integer extracted from a string in the list
ind | Index of string |
off | Offset into string to start extracting |
References WXP::Const::MISS.
|
inline |
Returns the number of strings in list
Referenced by WXP::CityTool::compareData(), WXP::ResrcDB::create(), WXP::Vtec::decode(), WXP::CityPlot::draw(), WXP::HodoPlot::draw(), WXP::MapPlot::draw(), WXP::MiscPlot::draw(), WXP::ProfPlot::draw(), WXP::RedbookPlot::draw(), WXP::SoundPlot::draw(), WXP::ThermPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::XSectionPlot::draw(), WXP::Graph::drawText(), WXP::ResrcCL::getKeyed(), WXP::ResrcCL::getPosition(), WXP::DatumAttr::parse(), WXP::ColorFile::read(), WXP::GifFile::read(), WXP::LZWComp::read(), WXP::PngFile::read(), WXP::SfcWxpFile::read(), WXP::WarnFile::read(), WXP::WmoIngest::readProdFile(), WXP::Prog::readResrcFile(), WXP::ColorFill::set(), WXP::ModelSpec::set(), WXP::ColorFill::set(), WXP::FloatArray::set(), WXP::Message::set(), WXP::NameConv::set(), WXP::Graph::setDevice(), WXP::Filename::setFile(), WXP::Filename::setFile(), WXP::Figure::setParam(), WXP::ObjectAnal::setParam(), WXP::VectPlot::setParam(), WXP::CityPlot::setParam(), WXP::ContPlot::setParam(), WXP::DatumPlot::setParam(), WXP::FrontPlot::setParam(), WXP::GridCont::setParam(), WXP::GridPlot::setParam(), WXP::GridVect::setParam(), WXP::HodoPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::LightPlot::setParam(), WXP::MapPlot::setParam(), WXP::MdrImage::setParam(), WXP::MdrPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MosPlot::setParam(), WXP::NidsImage::setParam(), WXP::NidsPlot::setParam(), WXP::ProfPlot::setParam(), WXP::RadPlot::setParam(), WXP::RawGrid::setParam(), WXP::RawPlot::setParam(), WXP::RcmDecode::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SoundPlot::setParam(), WXP::ThermPlot::setParam(), WXP::UpaDecode::setParam(), WXP::UpaPlot::setParam(), WXP::UpaXSectCont::setParam(), WXP::UpaXSectPlot::setParam(), WXP::WarnPlot::setParam(), WXP::WatchPlot::setParam(), WXP::WmoIngest::setParam(), WXP::XSectionPlot::setParam(), WXP::XWindow::setParam(), and WXP::CityHash::setup().
const char * Strings::getString | ( | int | ind | ) |
Returns the string at set position in list
ind | Index in list |
Referenced by WXP::CityTool::compareData(), WXP::ResrcDB::create(), WXP::Vtec::decode(), WXP::DomainTool::decode(), WXP::HurPlot::draw(), WXP::MapPlot::draw(), WXP::MiscPlot::draw(), WXP::ProfPlot::draw(), WXP::RedbookPlot::draw(), WXP::ThermPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::WarnPlot::draw(), WXP::WatchPlot::draw(), WXP::XSectionPlot::draw(), WXP::Graph::drawText(), WXP::ResrcCL::getKeyed(), WXP::Filename::getName(), WXP::ResrcCL::getPosition(), WXP::DatumAttr::parse(), WXP::ColorFile::read(), WXP::GifFile::read(), WXP::LZWComp::read(), WXP::PngFile::read(), WXP::WarnFile::read(), WXP::WmoIngest::readProdFile(), WXP::Prog::readResrcFile(), WXP::ColorFill::set(), WXP::ModelSpec::set(), WXP::ColorFill::set(), WXP::FloatArray::set(), WXP::Message::set(), WXP::NameConv::set(), WXP::Filename::setFile(), WXP::Filename::setFile(), WXP::Filename::setFile(), WXP::ObjectAnal::setParam(), WXP::VectPlot::setParam(), WXP::CityPlot::setParam(), WXP::ContPlot::setParam(), WXP::FrontPlot::setParam(), WXP::GridCont::setParam(), WXP::GridPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::LightPlot::setParam(), WXP::MapPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MosPlot::setParam(), WXP::NidsPlot::setParam(), WXP::RawPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SoundPlot::setParam(), WXP::UpaPlot::setParam(), WXP::WarnPlot::setParam(), WXP::WatchPlot::setParam(), and WXP::XWindow::setParam().
const char * Strings::getString | ( | int | ind, |
char | delim | ||
) |
Gets the string from the list starting at the delimiter
ind | Index of the string in the list to search |
delim | Character to search for |
const char * Strings::getString | ( | int | ind, |
int | off | ||
) |
Gets the string from the list starting at off
ind | Index of the string in the list to search |
off | Offset into string |
const char * Strings::getStringAfter | ( | int | ind, |
char | ch | ||
) |
Gets the string from the list starting after char
ind | Index of the string in the list to search |
ch | Character to search for |
References index().
Referenced by WXP::Figure::setParam(), WXP::ContPlot::setParam(), WXP::DatumPlot::setParam(), WXP::FrontPlot::setParam(), WXP::GridPlot::setParam(), WXP::HurPlot::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::MapPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MosPlot::setParam(), WXP::NidsPlot::setParam(), WXP::RadPlot::setParam(), WXP::RawPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SoundPlot::setParam(), WXP::ThermPlot::setParam(), WXP::UpaPlot::setParam(), WXP::WarnPlot::setParam(), WXP::WatchPlot::setParam(), and WXP::WmoIngest::setParam().
bool Strings::iequal | ( | int | ind, |
const char * | str | ||
) |
Determines if string is equal to one in the list (case insensitive)
ind | Index of string in list |
str | String to compare it to |
References WXP::StrLib::iequal().
Referenced by WXP::CityTool::compareData(), WXP::MapPlot::draw(), WXP::DatumAttr::parse(), WXP::Message::set(), WXP::CityPlot::setParam(), WXP::ContPlot::setParam(), WXP::GridCont::setParam(), WXP::GridVect::setParam(), WXP::ImagePlot::setParam(), WXP::Lev2Plot::setParam(), WXP::MdrPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MosPlot::setParam(), WXP::NidsImage::setParam(), WXP::NidsPlot::setParam(), WXP::ProfPlot::setParam(), WXP::RadPlot::setParam(), WXP::RawPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::SatPlot::setParam(), WXP::SfcPlot::setParam(), WXP::UpaPlot::setParam(), and WXP::UpaXSectPlot::setParam().
bool Strings::iequal | ( | int | ind, |
const char * | str, | ||
int | nlen | ||
) |
Determines if string is equal to one in the list (case insensitive)
ind | Index of string in list |
str | String to compare it to |
nlen | Number of characters in string to compare |
References WXP::StrLib::iequal().
bool Strings::iequal | ( | int | ind, |
int | off, | ||
const char * | str | ||
) |
Determines if string is equal to one in the list (case insensitive)
ind | Index of string in list |
off | Offset into string to start comparing |
str | String to compare it to |
References WXP::StrLib::iequal().
int Strings::index | ( | int | ind, |
char | ch | ||
) |
Returns the index of a character within a particular string
ind | Index of string in list |
ch | Character to search for |
References WXP::StrLib::index().
Referenced by getStringAfter(), WXP::ModelSpec::set(), WXP::Figure::setParam(), and WXP::XWindow::setParam().
int Strings::init | ( | ) |
int Strings::print | ( | ) |
Prints the class data to standard output
Referenced by WXP::MetaPlot::setParam().
int Strings::scanf | ( | int | ind, |
const char * | fmt, | ||
... | |||
) |
Scans a string in the list using a format (see sscanf)
ind | Index of string in list to scan |
fmt | Format to scan with |
... | Output parameters |
Referenced by WXP::Vtec::decode(), WXP::CityPlot::draw(), WXP::SfcWxpFile::read(), WXP::NameConv::set(), WXP::ContPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::MdrPlot::setParam(), WXP::NidsImage::setParam(), WXP::NidsPlot::setParam(), WXP::RcmPlot::setParam(), WXP::UpaDecode::setParam(), and WXP::XWindow::setParam().
int Strings::scanf | ( | int | ind, |
int | off, | ||
const char * | fmt, | ||
... | |||
) |
Scans a string in the list using a format (see sscanf)
ind | Index of string in list to scan |
off | Offset into string to start scanning from |
fmt | Format to scan with |
... | Output parameters |
int Strings::set | ( | const char * | string | ) |
Sets up strings given string and splits string on whitespace
string | Initial string to parse |
References WXP::StrLib::acopy(), and init().
int Strings::set | ( | const char * | string, |
char | delim | ||
) |
Sets up strings given string and delimiter
string | Initial string to parse |
delim | Delimiter to break string up |
References set().
int Strings::set | ( | const char * | string, |
char | delim, | ||
int | rnum | ||
) |
Sets up strings given string and delimiter
string | Initial string to parse |
delim | Delimiter to break string up |
rnum | Number of resulting fields (-1 for unlimited) |
References WXP::StrLib::acopy(), init(), and WXP::StrLib::length().
int Strings::set | ( | const char * | string, |
char | delim, | ||
int | rnum, | ||
const char * | groups | ||
) |
Sets up strings given string and delimiter
string | Initial string to parse |
delim | Delimiter to break string up |
rnum | Number of resulting fields (-1 for unlimited) |
References WXP::StrLib::acopy(), init(), and WXP::StrLib::length().
int Strings::set | ( | const char * | string, |
const char * | pattern | ||
) |
Sets the string table by parsing on a pattern.
string | String to parse |
pattern | Pattern to parse string on |
References WXP::StrLib::acopy(), and init().
int Strings::set | ( | const Strings & | strings | ) |
Sets the string data from another string class (used by copy constructor)
strings | String class to copy from |
References WXP::StrLib::acopy().
int Strings::set | ( | int | cnt, |
const char * | str[] | ||
) |
Sets up strings given an array of strings
cnt | Number of strings in array |
str | Array of strings |
References WXP::StrLib::acopy().
int Strings::set | ( | int | ind, |
const char * | string | ||
) |
Sets individual items in string list (overwrites existing string)
ind | The index to put the string |
string | The string to put into list |
References WXP::StrLib::acopy(), and expand().
int Strings::set | ( | int | rnum | ) |
Sets up strings with number of blanks
rnum | Number of blank strings to create |
Referenced by WXP::ProfPlot::draw(), WXP::ThermPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), operator=(), WXP::DatumAttr::parse(), WXP::WmoIngest::readProdFile(), WXP::Prog::readResrcFile(), WXP::ModelSpec::set(), set(), WXP::NameConv::set(), WXP::Filename::setFile(), WXP::Filename::setFile(), WXP::LightPlot::setParam(), Strings(), Strings(), Strings(), Strings(), Strings(), Strings(), and Strings().