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) | |
| Strings (const char *string) | |
| Strings (int cnt, const char *str[]) | |
| Strings (const Strings &strings) | |
| Strings | operator= (const Strings &strings) |
| ~Strings () | |
| int | init () |
| int | set (int num) |
| 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) |
| 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 | 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) |
| 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 | ) |
Constructor. Sets up strings with number of blanks
| rnum | Number of blank strings to create |
References init().
| Strings::Strings | ( | const char * | string, | |
| char | delim, | |||
| int | rnum | |||
| ) |
Constructor. 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 init().
| Strings::Strings | ( | const char * | string, | |
| char | delim | |||
| ) |
Constructor. Sets up strings given string and delimiter
| string | Initial string to parse | |
| delim | Delimiter to break string up |
References init().
| Strings::Strings | ( | const char * | string | ) |
Constructor. Sets up strings given string and splits string on whitespace
| string | Initial string to parse |
References init().
| Strings::Strings | ( | int | cnt, | |
| const char * | str[] | |||
| ) |
Constructor. Sets up strings given an array of strings
| cnt | Number of strings in array | |
| str | Array of strings |
References init().
| Strings::Strings | ( | const Strings & | strings | ) |
| Strings::~Strings | ( | ) |
Destructor. Frees allocated strings
| bool Strings::equal | ( | int | ind, | |
| const char * | str, | |||
| int | nlen | |||
| ) |
| bool Strings::equal | ( | int | ind, | |
| int | off, | |||
| const char * | str | |||
| ) |
| 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 |
Referenced by WXP::Vtec::decode(), WXP::DomainTool::decode(), equal(), WXP::GifFile::read(), WXP::NameConv::set(), WXP::Graph::setDevice(), WXP::Filename::setFile(), WXP::XWindow::setParam(), WXP::WatchPlot::setParam(), WXP::UpaPlot::setParam(), WXP::UpaDecode::setParam(), WXP::ThermPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RcmDecode::setParam(), WXP::RawPlot::setParam(), WXP::RadPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MosPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MapPlot::setParam(), WXP::LightPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::GridPlot::setParam(), WXP::GridCont::setParam(), WXP::FrontPlot::setParam(), WXP::Figure::setParam(), WXP::DatumPlot::setParam(), and WXP::Contour::setParam().
| 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(), and WXP::XWindow::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.
| 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::WatchPlot::setParam(), WXP::SatPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RawPlot::setParam(), WXP::MdrPlot::setParam(), WXP::LightPlot::setParam(), WXP::ImagePlot::setParam(), and WXP::FrontPlot::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::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::NameConv::set(), WXP::ModelSpec::set(), WXP::Message::set(), WXP::WatchPlot::setParam(), WXP::SatPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::RcmPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MdrPlot::setParam(), WXP::LightPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::FrontPlot::setParam(), WXP::Figure::setParam(), and WXP::CityPlot::setParam().
| 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::XWindow::setParam(), WXP::RcmPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MdrPlot::setParam(), WXP::Lev2Plot::setParam(), and WXP::CityPlot::setParam().
| int WXP::Strings::getNum | ( | ) | [inline] |
Returns the number of strings in list
Referenced by WXP::CityTool::compareData(), WXP::ResrcDB::create(), WXP::Vtec::decode(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::ThermPlot::draw(), WXP::RedbookPlot::draw(), WXP::MapPlot::draw(), WXP::HodoPlot::draw(), WXP::CityPlot::draw(), WXP::Graph::drawText(), WXP::ResrcCL::getKeyed(), WXP::ResrcCL::getPosition(), WXP::SfcWxpFile::read(), WXP::GifFile::read(), WXP::ColorFile::read(), WXP::Prog::readResrcFile(), WXP::NameConv::set(), WXP::ModelSpec::set(), WXP::Message::set(), WXP::ColorFill::set(), WXP::Graph::setDevice(), WXP::Filename::setFile(), WXP::Filename::setFilePrompt(), WXP::XWindow::setParam(), WXP::WatchPlot::setParam(), WXP::UpaXSectPlot::setParam(), WXP::UpaXSectCont::setParam(), WXP::UpaPlot::setParam(), WXP::UpaDecode::setParam(), WXP::ThermPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RcmDecode::setParam(), WXP::RawPlot::setParam(), WXP::RadPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MosPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MapPlot::setParam(), WXP::LightPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::HodoPlot::setParam(), WXP::GridPlot::setParam(), WXP::GridCont::setParam(), WXP::FrontPlot::setParam(), WXP::Figure::setParam(), WXP::DatumPlot::setParam(), WXP::Contour::setParam(), and WXP::CityPlot::setParam().
| 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::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 | ) |
Returns the string at set position in list
| ind | Index in list |
Referenced by WXP::ResrcDB::create(), WXP::Vtec::decode(), WXP::DomainTool::decode(), WXP::WatchPlot::draw(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::RedbookPlot::draw(), WXP::MapPlot::draw(), WXP::Graph::drawText(), WXP::ResrcCL::getKeyed(), WXP::ResrcCL::getPosition(), WXP::GifFile::read(), WXP::ColorFile::read(), WXP::Prog::readResrcFile(), WXP::NameConv::set(), WXP::ModelSpec::set(), WXP::Message::set(), WXP::ColorFill::set(), WXP::Filename::setFile(), WXP::Filename::setFilePrompt(), WXP::XWindow::setParam(), WXP::WatchPlot::setParam(), WXP::UpaPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RawPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MosPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MeteoPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MapPlot::setParam(), WXP::LightPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::GridPlot::setParam(), WXP::GridCont::setParam(), WXP::FrontPlot::setParam(), WXP::DatumPlot::setParam(), WXP::Contour::setParam(), and WXP::CityPlot::setParam().
| 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::UpaPlot::setParam(), WXP::ThermPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RawPlot::setParam(), WXP::RadPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MosPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MdrPlot::setParam(), WXP::MapPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::GridPlot::setParam(), WXP::FrontPlot::setParam(), WXP::Figure::setParam(), WXP::DatumPlot::setParam(), and WXP::Contour::setParam().
| bool Strings::iequal | ( | int | ind, | |
| const char * | str, | |||
| int | nlen | |||
| ) |
| bool Strings::iequal | ( | int | ind, | |
| int | off, | |||
| const char * | str | |||
| ) |
| 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 |
Referenced by WXP::CityTool::compareData(), WXP::MapPlot::draw(), iequal(), WXP::Message::set(), WXP::UpaPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RedbookPlot::setParam(), WXP::RcmPlot::setParam(), WXP::RawPlot::setParam(), WXP::RadPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MosPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MetaPlot::setParam(), WXP::MdrPlot::setParam(), WXP::Lev2Plot::setParam(), WXP::ImagePlot::setParam(), WXP::GridCont::setParam(), and WXP::CityPlot::setParam().
| 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 |
Referenced by WXP::DomainTool::decode(), getStringAfter(), WXP::ModelSpec::set(), WXP::XWindow::setParam(), and WXP::Figure::setParam().
Assignment operator. Used to overload copying
| strings | String class to copy from |
| int Strings::print | ( | ) |
Prints the class data to standard output
Referenced by WXP::MetaPlot::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::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::XWindow::setParam(), WXP::UpaDecode::setParam(), WXP::RcmPlot::setParam(), WXP::NidsPlot::setParam(), WXP::MdrPlot::setParam(), WXP::Lev2Plot::setParam(), and WXP::Contour::setParam().
| 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 | ( | 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 |
| 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 | ( | 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().
| int Strings::set | ( | int | rnum | ) |
Sets up strings with number of blanks
| rnum | Number of blank strings to create |
Referenced by WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::Prog::readResrcFile(), WXP::NameConv::set(), WXP::ModelSpec::set(), WXP::Filename::setFile(), WXP::Filename::setFilePrompt(), and WXP::LightPlot::setParam().
1.6.1