WXP::String Class Reference
This is a variable length string class.
More...
#include "../include/String.h"
List of all members.
Detailed Description
This is a variable length string class.
- Author:
- Dan Vietor
Constructor & Destructor Documentation
| String::String |
( |
int |
length |
) |
|
Constructor of string with specified length
- Parameters:
-
References init().
Constructor of string. Length is 80 characters.
References init().
| String::String |
( |
const char * |
str |
) |
|
Constructor of string based on existing string
- Parameters:
-
| str | String to initialize data to |
| String::String |
( |
const String & |
string |
) |
|
Copy constructor.
- Parameters:
-
References init().
Member Function Documentation
| int String::append |
( |
char |
ch |
) |
|
Appends a single character to the end of the main string
- Parameters:
-
References resize().
| int String::append |
( |
const char * |
str, |
|
|
int |
num | |
|
) |
| | |
Appends num number of characters from specified string to the end of main string
- Parameters:
-
| str | String to append |
| num | Number of characters to append |
References resize().
| int String::append |
( |
String & |
str |
) |
|
Appends specified string to the end of main string
- Parameters:
-
References append(), and get().
| int String::append |
( |
const char * |
str |
) |
|
Appends specified string to the end of main string
- Parameters:
-
References resize().
Referenced by WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addPathDelim(), WXP::FileTool::addUserPath(), append(), WXP::FileTool::checkPath(), WXP::DateTool::createLabel(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaPlot::draw(), WXP::SfcPlot::draw(), WXP::MosPlot::draw(), WXP::NameConv::encode(), WXP::ResrcEnv::get(), WXP::WxTool::getMetarWeather(), WXP::WxTool::getMetarWeatherText(), WXP::ResrcFile::open(), WXP::MosRaw::setForeTime(), WXP::GridPlot::setForeTime(), WXP::Variable::toLabel(), WXP::Variable::toString(), WXP::ForeTime::toString(), WXP::Date::toText(), and WXP::ForeTime::toVarLabel().
| int String::aprintf |
( |
const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
Chops the last character off the string
Clears the string
Referenced by WXP::Filename::checkFile(), WXP::DateTool::createHourLabel(), WXP::DateTool::createLabel(), WXP::UpaPlot::draw(), WXP::SfcPlot::draw(), WXP::MosPlot::draw(), WXP::NameConv::encode(), WXP::ResrcFile::get(), WXP::Region::get(), WXP::ResrcCL::getKeyed(), WXP::WxTool::getMetarWeatherText(), WXP::VarFileData::init(), WXP::NameConv::initParam(), WXP::Variable::toLabel(), WXP::Level::toLabel(), WXP::Variable::toString(), WXP::Level::toString(), WXP::ForeTime::toString(), WXP::Date::toText(), WXP::ForeTime::toTimeLabel(), and WXP::ForeTime::toTimeLabelDay().
| bool String::contains |
( |
const char * |
str |
) |
|
Checks to see if string contains a specified string.
- Parameters:
-
| str | See if this string is contained in main string |
| int String::copy |
( |
const char * |
str, |
|
|
int |
num | |
|
) |
| | |
Copies num number of characters from specified string into main string
- Parameters:
-
| str | String to copy from |
| num | The number of characters to copy |
References resize().
| int String::copy |
( |
String & |
str |
) |
|
Copies specified string into main string
- Parameters:
-
References copy(), and get().
| int String::copy |
( |
const char * |
str |
) |
|
Copies specified string into main string
- Parameters:
-
References resize().
Referenced by WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addUserPath(), WXP::FileTool::checkPath(), copy(), WXP::DateTool::createHourLabel(), WXP::ResrcDB::decodeProgramName(), WXP::ResrcFile::get(), WXP::ResrcEnv::get(), WXP::Region::get(), WXP::ResrcCL::getKeyed(), WXP::WxTool::getMetarWeather(), WXP::ResrcCL::getPosition(), WXP::Resrc::getValues(), WXP::WxTool::getWeatherText(), WXP::ResrcFile::open(), set(), and WXP::ForeTime::toString().
| bool String::equal |
( |
const char * |
str, |
|
|
int |
num | |
|
) |
| | |
Is the string equal to a specified string. Only first num characters compared.
- Parameters:
-
| str | String to compare to |
| num | Number of characters to compare |
| bool String::equal |
( |
const char * |
str |
) |
|
| const char * String::get |
( |
int |
ind |
) |
|
Returns a string starting at a specific index
- Parameters:
-
| const char * String::get |
( |
|
) |
|
Gets the string data
- Return values:
-
Referenced by WXP::GridMath::add(), WXP::FileTool::addOutPath(), WXP::FileTool::addPath(), WXP::FileTool::addPathDelim(), append(), WXP::Unit::change(), WXP::FileTool::checkPath(), WXP::UpaRaw::compute(), WXP::SfcRaw::compute(), WXP::ObjectAnal::compute(), WXP::MosRaw::compute(), copy(), WXP::ResrcDB::create(), WXP::DomainTool::decode(), WXP::ResrcDB::decodeProgramName(), WXP::GridMath::diff(), WXP::GridMath::div(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaPlot::draw(), WXP::SfcPlot::draw(), WXP::SatPlot::draw(), WXP::RedbookPlot::draw(), WXP::RcmPlot::draw(), WXP::RawPlot::draw(), WXP::NidsPlot::draw(), WXP::MosPlot::draw(), WXP::MiscPlot::draw(), WXP::MeteoPlot::draw(), WXP::MdrPlot::draw(), WXP::MapPlot::draw(), WXP::LightPlot::draw(), WXP::Lev2Plot::draw(), WXP::GridPlot::draw(), WXP::GridCont::draw(), WXP::FrontPlot::draw(), WXP::CityPlot::draw(), WXP::NidsPlot::drawData(), WXP::ImagePlot::drawImage(), WXP::NameConv::encode(), WXP::Figure::endPlot(), WXP::File::File(), WXP::ResrcFile::get(), WXP::ResrcEnv::get(), WXP::Region::get(), WXP::ModelName::get(), WXP::GridCont::getDomain(), WXP::Filename::getHeader(), WXP::Filename::getName(), WXP::NameConv::getPath(), WXP::ResrcFile::getValid(), WXP::Filename::listFile(), WXP::GribFile::makeDatim(), WXP::GribFile::makeInfo(), WXP::GridMath::mult(), WXP::SfcXmlFile::open(), WXP::SfcWxpFile::open(), WXP::ResrcFile::open(), WXP::Graph::open(), WXP::File::open(), WXP::BufrFile::open(), WXP::VarSpec::print(), WXP::SfcPlot::print(), WXP::SfcData::print(), WXP::NidsPlot::print(), WXP::MosUData::print(), WXP::MosData::print(), WXP::Message::print(), WXP::Grid::print(), WXP::Filename::print(), WXP::Grid::printInfo(), WXP::SfcData::printLine(), WXP::MosData::printTable(), WXP::ColorFile::read(), WXP::Unit::readFile(), WXP::ResrcFile::readFile(), WXP::SatUniFile::readHeader(), WXP::Prog::readResrcFile(), WXP::FileTool::remove(), WXP::CityTool::search(), WXP::Resrc::set(), WXP::NameConv::set(), WXP::ModelSpec::set(), WXP::Filename::set(), WXP::CityHash::set(), WXP::Filename::setDate(), WXP::NameConv::setFile(), WXP::NameConvFile::setFilename(), WXP::Filename::setFilePrompt(), WXP::Graph::setFont(), WXP::NameConvFile::setHdrFilename(), WXP::NameConv::setLatest(), WXP::Graph::setSymbol(), WXP::RcmDecode::setup(), WXP::VarSpec::toInfoLabel(), WXP::Variable::toLabel(), WXP::Variable::toString(), and WXP::ImgWxpFile::write().
| char String::getChar |
( |
int |
ind |
) |
|
| const char* WXP::String::getPtr |
( |
|
) |
[inline] |
Returns internal data pointer
| bool String::iequal |
( |
const char * |
str, |
|
|
int |
num | |
|
) |
| | |
Is the string equal to a specified string. Only first num characters compared. Case insensitive.
- Parameters:
-
| str | String to compare to |
| num | Number of characters to compare |
| bool String::iequal |
( |
const char * |
str |
) |
|
| int String::index |
( |
char |
ch |
) |
|
Returns the index of a specific character
- Parameters:
-
| ch | The character to search for |
- Returns:
- The index or -1
| int String::init |
( |
int |
length |
) |
|
Initializes the string data
- Parameters:
-
| length | Length of allocated string |
References init().
| int String::maxLength |
( |
|
) |
|
Gets the maximum length of the allocated string
- Returns:
- Maximum length of allocated string
| int String::occurs |
( |
char |
ch |
) |
|
Assignment operator. Used to overload copying
- Parameters:
-
| strings | String class to copy from |
| int String::printf |
( |
const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
Formats data into character string like sprintf
- Parameters:
-
| fmt | Sprintf format |
| ... | Additional parameters to sprintf |
Referenced by WXP::Unit::change(), WXP::DateTool::createHourLabel(), WXP::UpaXSectPlot::draw(), WXP::UpaXSectCont::draw(), WXP::ResrcEnv::get(), WXP::XWindow::getDevice(), WXP::SfcData::outString(), print(), WXP::Unit::scale(), WXP::Level::toLabel(), WXP::Level::toString(), WXP::ForeTime::toString(), WXP::ForeTime::toTimeLabel(), WXP::ForeTime::toTimeLabelDay(), and WXP::ForeTime::toVarLabel().
| int String::replace |
( |
char |
tar, |
|
|
char |
rep | |
|
) |
| | |
Replaces characters in a string
- Parameters:
-
| tar | Target character to replace |
| rep | The character to replace with |
Resizes the string by doubling the size of the allocated data
Referenced by append(), and copy().
| int String::resize |
( |
int |
length |
) |
|
Resizes the string by changing maximum length of allocated data
- Parameters:
-
| length | New length of string data |
Rewinds internal data pointer
| int String::scanf |
( |
const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
| int String::scanp |
( |
const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
Does a parsing scan on the string
- Parameters:
-
| fmt | Scanf format |
| ... | Additional parameters for sscanf |
- See also:
- sscanf
| int String::set |
( |
const String & |
string |
) |
|
Sets the content of string
- Parameters:
-
| string | String to set content to |
References copy().
| int String::set |
( |
const char * |
str |
) |
|
Sets the content of string
- Parameters:
-
References copy().
Referenced by WXP::Filename::checkFile(), WXP::DateTool::createLabel(), WXP::ModelName::get(), WXP::AreaFile::getComment(), WXP::SfcData::outString(), WXP::Unit::parse(), WXP::ResrcFile::parseName(), WXP::Menu::prompt(), WXP::Message::set(), WXP::Filename::set(), WXP::UpaPlot::setColor(), WXP::SfcPlot::setColor(), WXP::RcmPlot::setColor(), WXP::NidsPlot::setColor(), WXP::MosPlot::setColor(), WXP::MdrPlot::setColor(), WXP::LightPlot::setColor(), WXP::VectPlot::setColorFill(), WXP::SatPlot::setColorFill(), WXP::RcmPlot::setColorFill(), WXP::RadPlot::setColorFill(), WXP::NidsPlot::setColorFill(), WXP::MdrPlot::setColorFill(), WXP::Lev2Plot::setColorFill(), WXP::ImagePlot::setColorFill(), WXP::GridPlot::setColorFill(), WXP::DatumPlot::setColorFill(), WXP::Contour::setColorFill(), WXP::Contour::setColorLabel(), WXP::VectPlot::setColorLine(), WXP::Contour::setColorLine(), WXP::VectPlot::setColorTable(), WXP::UpaPlot::setColorTable(), WXP::SfcPlot::setColorTable(), WXP::SatPlot::setColorTable(), WXP::RcmPlot::setColorTable(), WXP::RadPlot::setColorTable(), WXP::NidsPlot::setColorTable(), WXP::MosPlot::setColorTable(), WXP::MdrPlot::setColorTable(), WXP::Lev2Plot::setColorTable(), WXP::ImagePlot::setColorTable(), WXP::GridPlot::setColorTable(), WXP::DatumPlot::setColorTable(), WXP::Contour::setColorTable(), WXP::Filename::setDate(), WXP::Filename::setFile(), WXP::CityPlot::setFilename(), WXP::Filename::setFilePrompt(), WXP::MosRaw::setForeTime(), WXP::MosPlot::setForeTime(), WXP::GridPlot::setForeTime(), WXP::Filename::setHeader(), WXP::Plot::setLabelColor(), WXP::UpaRaw::setLevel(), WXP::UpaPlot::setLevel(), WXP::Filename::setName(), WXP::UpaPlot::setParam(), WXP::SfcPlot::setParam(), WXP::SatPlot::setParam(), WXP::RawPlot::setParam(), WXP::RadPlot::setParam(), WXP::MosPlot::setParam(), WXP::MiscPlot::setParam(), WXP::MapPlot::setParam(), WXP::LightPlot::setParam(), WXP::GridPlot::setParam(), WXP::GridCont::setParam(), WXP::Figure::setParam(), WXP::NameConv::setPath(), WXP::UpaRaw::setVariable(), WXP::UpaPlot::setVariable(), WXP::SfcRaw::setVariable(), WXP::SfcPlot::setVariable(), WXP::RcmPlot::setVariable(), WXP::NidsPlot::setVariable(), WXP::MosRaw::setVariable(), WXP::MosPlot::setVariable(), WXP::MdrPlot::setVariable(), WXP::GridPlot::setVariable(), WXP::VarSpec::toInfoLabel(), WXP::MosData::weather12(), and WXP::MosData::weather6().
Strips all white space characters from the string
| int String::trunc |
( |
int |
num |
) |
|
Does the string contain data (length > 0)
- Returns:
- true if contains data
Referenced by WXP::UpaRaw::compute(), WXP::SfcRaw::compute(), WXP::MosRaw::compute(), WXP::UpaPlot::draw(), WXP::SfcPlot::draw(), WXP::SatPlot::draw(), WXP::RcmPlot::draw(), WXP::RawPlot::draw(), WXP::NidsPlot::draw(), WXP::MosPlot::draw(), WXP::MapPlot::draw(), WXP::LightPlot::draw(), WXP::Lev2Plot::draw(), WXP::GridPlot::draw(), WXP::GridCont::draw(), WXP::NidsPlot::drawData(), WXP::ImagePlot::drawImage(), WXP::NameConv::encode(), WXP::Figure::endPlot(), WXP::GribFile::makeInfo(), WXP::SatUniFile::readHeader(), WXP::VarSpec::toInfoLabel(), and WXP::Filename::validHeader().
The documentation for this class was generated from the following files: