|
WXP C++ Library Version 6.74.9
|
This is a variable length string class. More...
#include "../include/String.h"
Public Member Functions | |
| int | init () |
| int | init (int length) |
| String (int length) | |
| String () | |
| String (const char *str) | |
| String (const String &string) | |
| String | operator= (const String &string) |
| ~String () | |
| int | set (const char *str) |
| int | set (const String &string) |
| int | reset () |
| bool | valid () |
| bool | isAlphaNum () |
| const char * | get () |
| const char * | get (int ind) |
| char | getChar (int ind) |
| int | length () |
| int | maxLength () |
| int | clear () |
| int | resize (int length) |
| int | resize () |
| int | rewind () |
| const char * | getPtr () |
| int | scanf (const char *mess,...) |
| int | scanp (const char *mess,...) |
| int | printf (const char *mess,...) |
| int | aprintf (const char *mess,...) |
| int | replace (char tar, char rep) |
| int | trimWS () |
| int | stripWS () |
| int | chop () |
| int | upCase () |
| int | lowCase () |
| int | index (char ch) |
| bool | equal (const char *str) |
| bool | equal (const char *str, int num) |
| bool | iequal (const char *str) |
| bool | iequal (const char *str, int num) |
| bool | contains (const char *str) |
| int | occurs (char ch) |
| int | copy (const char *str) |
| int | copy (String &str) |
| int | copy (const char *str, int num) |
| int | append (const char *str) |
| int | append (String &str) |
| int | append (const char *str, int num) |
| int | append (char str) |
| int | trunc (int ind) |
| int | print () |
This is a variable length string class.
| String::String | ( | int | length | ) |
| String::String | ( | ) |
Constructor of string. Length is 80 characters.
References init().
| String::String | ( | const char * | str | ) |
Constructor of string based on existing string
| str | String to initialize data to |
| String::String | ( | const String & | string | ) |
| String::~String | ( | ) |
Destructor
| int String::append | ( | char | ch | ) |
Appends a single character to the end of the main string
| ch | Character to append |
References resize().
| int String::append | ( | const char * | str | ) |
Appends specified string to the end of main string
| str | String to append |
References resize().
Referenced by WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addPathDelim(), WXP::FileTool::addUserPath(), append(), WXP::FileTool::checkPath(), WXP::DateTool::createLabel(), WXP::DateTool::createLabel(), WXP::DateTool::createLabel(), WXP::MosPlot::draw(), WXP::ProfPlot::draw(), WXP::SfcPlot::draw(), WXP::UpaPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::NameConv::encode(), WXP::ResrcEnv::get(), WXP::WxTool::getSAWeather(), WXP::WxTool::getTextFromWeather(), WXP::VarName::makeLabel(), WXP::ResrcFile::open(), WXP::VarFile::read(), WXP::Variable::toAbbrCode(), WXP::Level::toLabel(), WXP::Variable::toLabel(), WXP::ForeTime::toString(), WXP::Level::toString(), WXP::Variable::toString(), WXP::Date::toText(), and WXP::ForeTime::toVarLabel().
| int String::append | ( | const char * | str, |
| int | num ) |
| int String::append | ( | String & | str | ) |
| int String::aprintf | ( | const char * | fmt, |
| ... ) |
Formats data into character string like sprintf, appends to end of string.
| fmt | Sprintf format |
| ... | Additional parameters to sprintf |
Referenced by WXP::DateTool::createLabel(), WXP::SfcData::outString(), WXP::ForeTime::toString(), and WXP::Date::toText().
| int String::chop | ( | ) |
Chops the last character off the string
Referenced by WXP::VarFile::read().
| int String::clear | ( | ) |
Clears the string
Referenced by WXP::DateTool::createHourLabel(), WXP::DateTool::createLabel(), WXP::MosPlot::draw(), WXP::SfcPlot::draw(), WXP::UpaPlot::draw(), WXP::NameConv::encode(), WXP::Region::get(), WXP::ResrcFile::get(), WXP::ResrcCL::getKeyed(), WXP::FileTool::getPath(), WXP::WxTool::getTextFromWeather(), WXP::Variable::toAbbrCode(), WXP::Level::toLabel(), WXP::Variable::toLabel(), WXP::ForeTime::toString(), WXP::Level::toString(), WXP::Variable::toString(), WXP::Date::toText(), WXP::ForeTime::toTimeLabel(), WXP::ForeTime::toTimeLabel(), and WXP::ForeTime::toTimeLabelDay().
| bool String::contains | ( | const char * | str | ) |
Checks to see if string contains a specified string.
| str | See if this string is contained in main string |
| int String::copy | ( | const char * | str | ) |
Copies specified string into main string
| str | String to copy from |
References resize().
Referenced by WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addUserPath(), WXP::FileTool::checkPath(), copy(), WXP::DateTool::createHourLabel(), WXP::ResrcDB::decodeProgramName(), WXP::Region::get(), WXP::ResrcEnv::get(), WXP::ResrcFile::get(), WXP::ResrcCL::getKeyed(), WXP::MosData::getObvis(), WXP::FileTool::getPath(), WXP::ResrcCL::getPosition(), WXP::WxTool::getSAWeather(), WXP::WxTool::getTextFromSAWeather(), WXP::Resrc::getValues(), WXP::WxTool::getWeather(), WXP::ResrcFile::open(), WXP::VarFile::read(), set(), set(), and WXP::ForeTime::toString().
| int String::copy | ( | const char * | str, |
| int | num ) |
| int String::copy | ( | String & | str | ) |
| bool String::equal | ( | const char * | str | ) |
Is the string equal to specified string
| str | String to compare to |
Referenced by WXP::Menu::prompt(), and WXP::SatCdfFile::readHeader().
| bool String::equal | ( | const char * | str, |
| int | num ) |
Is the string equal to a specified string. Only first num characters compared.
| str | String to compare to |
| num | Number of characters to compare |
| const char * String::get | ( | ) |
Gets the string data
| str | String data |
Referenced by WXP::GridMath::abs(), WXP::GridMath::add(), WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addPathDelim(), append(), WXP::Unit::change(), WXP::FileTool::checkPath(), WXP::MosRaw::compute(), WXP::ObjectAnal::compute(), WXP::SfcRaw::compute(), WXP::UpaRaw::compute(), copy(), WXP::ResrcDB::create(), WXP::DomainTool::decode(), WXP::ResrcDB::decodeProgramName(), WXP::GridMath::diff(), WXP::GridMath::div(), WXP::FrontPlot::draw(), WXP::GridPlot::draw(), WXP::Lev2Plot::draw(), WXP::LightPlot::draw(), WXP::MapPlot::draw(), WXP::MdrPlot::draw(), WXP::MeteoPlot::draw(), WXP::MosPlot::draw(), WXP::ProfPlot::draw(), WXP::RawPlot::draw(), WXP::RcmPlot::draw(), WXP::RedbookPlot::draw(), WXP::SfcPlot::draw(), WXP::UpaPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::NidsPlot::drawData(), WXP::ContPlot::drawLabels(), WXP::VectPlot::drawLabels(), WXP::ContPlot::drawLineLabels(), WXP::ContPlot::drawMaxMin(), WXP::ContPlot::drawValues(), WXP::VectPlot::drawVect(), WXP::NameConv::encode(), WXP::GridMath::exp(), WXP::File::File(), WXP::ModelName::get(), WXP::ModelName::get(), WXP::Region::get(), WXP::ResrcEnv::get(), WXP::ResrcFile::get(), WXP::GridCont::getDomain(), WXP::GridVect::getDomain(), WXP::ResrcFile::getValid(), WXP::GridMath::inv(), WXP::Filename::listFile(), WXP::GridMath::log(), WXP::GridMath::log10(), WXP::GribFile::makeDatim(), WXP::GribFile::makeInfo(), WXP::GridMath::max(), WXP::GridMath::min(), WXP::GridMath::mod(), WXP::GridMath::mult(), WXP::BufrFile::open(), WXP::File::open(), WXP::File::open(), WXP::Graph::open(), WXP::ResrcFile::open(), WXP::SfcWxpFile::open(), WXP::SfcXmlFile::open(), WXP::VarFile::open(), WXP::GridMath::pow(), WXP::Grid::print(), WXP::MdrData::print(), WXP::Message::print(), WXP::MosData::print(), WXP::MosUData::print(), WXP::RcmData::print(), WXP::SfcData::print(), WXP::VarSpec::print(), WXP::Grid::printInfo(), WXP::SfcData::printLine(), WXP::WmoIngest::printLog(), WXP::MosData::printTable(), WXP::ColorFile::read(), WXP::ResrcFile::readFile(), WXP::Unit::readFile(), WXP::WmoIngest::readProdFile(), WXP::Prog::readResrcFile(), WXP::FileTool::remove(), WXP::CityTool::search(), WXP::VarName::searchFile(), WXP::VarName::searchFile(), WXP::ModelSpec::set(), WXP::NameConv::set(), WXP::Resrc::set(), WXP::Grid::setDatim(), WXP::NameConv::setFile(), WXP::NameConvFile::setFilename(), WXP::Graph::setFont(), WXP::NameConvFile::setHdrFilename(), WXP::NameConv::setLatest(), WXP::Graph::setSymbol(), WXP::CityHash::setup(), WXP::CityHash::setup(), WXP::RcmDecode::setup(), WXP::UpaRawinHash::setup(), WXP::Unit::simplify(), WXP::GridMath::sqrt(), WXP::Variable::toAbbrCode(), WXP::VarSpec::toInfoLabel(), WXP::Variable::toLabel(), WXP::Variable::toString(), WXP::License::valid(), and WXP::ImgWxpFile::write().
| const char * String::get | ( | int | ind | ) |
Returns a string starting at a specific index
| ind | Index to start |
| char String::getChar | ( | int | ind | ) |
Gets a specific character out of the string
| ind | Index of character to retrieve |
Referenced by WXP::FileTool::addPathDelim(), WXP::Region::get(), WXP::ResrcFile::get(), WXP::ColorFile::readFile(), WXP::RedbookFile::readHeader(), and WXP::NameConv::set().
|
inline |
Returns internal data pointer
| bool String::iequal | ( | const char * | str | ) |
Is the string equal to specified string (case insensitive)
| str | String to compare to |
Referenced by WXP::ResrcFile::get(), WXP::Menu::prompt(), and WXP::ColorFile::readFile().
| bool String::iequal | ( | const char * | str, |
| int | num ) |
Is the string equal to a specified string. Only first num characters compared. Case insensitive.
| str | String to compare to |
| num | Number of characters to compare |
| int String::index | ( | char | ch | ) |
Returns the index of a specific character
| ch | The character to search for |
| int String::init | ( | ) |
Initializes the string data
Referenced by init(), WXP::ShapeFile::open(), WXP::NameConv::setLatest(), String(), String(), and String().
| int String::init | ( | int | length | ) |
| int String::length | ( | ) |
Gets length of string
| len | Length of string |
Referenced by WXP::FileTool::addPathDelim(), WXP::ResrcDB::create(), WXP::DateTool::createLabel(), WXP::ResrcDB::decodeProgramName(), WXP::ResrcEnv::get(), WXP::VarName::get(), WXP::WxTool::getTextFromWeather(), init(), WXP::Filename::listFile(), resize(), WXP::NameConv::set(), and String().
| int String::lowCase | ( | ) |
Converts the string to lower case
Referenced by WXP::ResrcDB::decodeProgramName(), and WXP::ResrcFile::get().
| int String::maxLength | ( | ) |
Gets the maximum length of the allocated string
| int String::occurs | ( | char | ch | ) |
Returns the number of times a character occurs within string
| ch | Character to search for |
| int String::print | ( | ) |
Prints the class values to standard output
| int String::printf | ( | const char * | fmt, |
| ... ) |
Formats data into character string like sprintf
| fmt | Sprintf format |
| ... | Additional parameters to sprintf |
Referenced by WXP::Unit::change(), WXP::DateTool::createHourLabel(), WXP::ProfPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::ResrcEnv::get(), WXP::XWindow::getDevice(), WXP::SfcData::outString(), WXP::Unit::scale(), WXP::ForeTime::toString(), WXP::ForeTime::toTimeLabel(), WXP::ForeTime::toTimeLabel(), WXP::ForeTime::toTimeLabelDay(), WXP::ForeTime::toVarLabel(), and WXP::ImgWxpFile::write().
| int String::replace | ( | char | tar, |
| char | rep ) |
Replaces characters in a string
| tar | Target character to replace |
| rep | The character to replace with |
| int String::reset | ( | ) |
Resets string data
| int String::resize | ( | ) |
| int String::resize | ( | int | length | ) |
| int String::rewind | ( | ) |
Rewinds internal data pointer
| int String::scanf | ( | const char * | fmt, |
| ... ) |
Does a sscanf on the string
| fmt | Scanf format |
| ... | Additional parameters for sscanf |
Referenced by WXP::Region::get(), WXP::ResrcFile::get(), WXP::Menu::prompt(), WXP::ColorFile::readFile(), and WXP::NameConv::set().
| int String::scanp | ( | const char * | fmt, |
| ... ) |
Does a parsing scan on the string
| fmt | Scanf format |
| ... | Additional parameters for sscanf |
| int String::set | ( | const char * | str | ) |
Sets the content of string
| str | String to set content to |
References copy().
Referenced by WXP::DateTool::createLabel(), WXP::DateTool::createLabel(), WXP::DateTool::createLabel(), WXP::ModelName::get(), WXP::VarName::get(), WXP::AreaFile::getComment(), WXP::VarName::makeLabel(), operator=(), WXP::SfcData::outString(), WXP::Unit::parse(), WXP::ResrcFile::parseName(), WXP::Menu::prompt(), WXP::Prog::prompt(), WXP::Prog::prompt(), WXP::Unit::simplify(), String(), WXP::VarSpec::toInfoLabel(), WXP::MosData::weather12(), and WXP::MosData::weather6().
| int String::set | ( | const String & | string | ) |
| int String::stripWS | ( | ) |
Strips all white space characters from the string
Referenced by WXP::VarFile::read().
| int String::trimWS | ( | ) |
Trims whitespace characters off the end of the string
Referenced by WXP::ColorFile::readFile().
| int String::trunc | ( | int | num | ) |
Truncates string to num characters.
| num | Number of characters for the string to contain. If less than 0, num is offset from length of string |
Referenced by WXP::ResrcDB::decodeProgramName(), and WXP::ResrcFile::get().
| int String::upCase | ( | ) |
Converts the string to upper case
Referenced by WXP::ResrcEnv::get().
| bool String::valid | ( | ) |
Does the string contain data (length > 0)
Referenced by WXP::VectPlot::drawLabels(), WXP::GribFile::makeInfo(), and WXP::VarSpec::toInfoLabel().