Some utility functions for manipulating std::strings. More...
Functions | |
template<typename Number > | |
std::string | NumToString (const Number &aNumber) |
Write the number as a String. | |
std::string | ToLower (const std::string &str) |
Convert std::string to lower case. | |
void | split (const std::string &str, char sep, StringMap &words) |
void | splitDoublet (const std::string &str, std::string &value1, std::string &value2) |
Split a xx.yy std::string into xx and yy. | |
void | parseTextFile (const std::string &fileName, std::map< int, StringMap > &text) |
bool | hasSubstr (const std::string &name, const std::string &substr) |
Returns true if the given name contains the given substring. |
Some utility functions for manipulating std::strings.
bool StringOps::hasSubstr | ( | const std::string & | name, | |
const std::string & | substr | |||
) |
Returns true if the given name contains the given substring.
Referenced by DataMethod< DataType >::determineDetectionSourceAndTarget(), DataMethod< DataType >::determineSourceAndTarget(), isAperMag(), isMagnitude(), isMagnitudeError(), and makeTargetList().
std::string StringOps::NumToString | ( | const Number & | aNumber | ) | [inline] |
Write the number as a String.
Referenced by SourceTable::calcMergedClass(), CameoSet::CameoSet(), Table< DataType >::checkData(), convertType(), CameoSet::countCameoSchemas(), SloanCoords< DataType >::doit(), ObjectID< DataType >::doit(), HtmIndex< DataType >::doit(), GalacticCoords< DataType >::doit(), RaDecByAst< DataType >::doit2(), ByteArray::dump(), extractMetadata(), extractSources(), SourceTable::fillExtinctionValues(), ByteArray::gobble(), FitsFile::handleError(), HtmIndex< DataType >::HtmIndex(), SourceTable::insertAstrometricData(), insertKeywordValue(), SourceTable::insertUserSupplied(), MergeTable::read(), CameoSet::readCameoData(), FitsFile::readColumnUnit(), OptionsFiller::setOption(), ColourIndex< DataType >::setSource(), TableData< Numeric >::testRange(), Table< DataType >::varcharTest(), VersionNum< DataType >::VersionNum(), and SourceTable::writeAsBinary().
void StringOps::parseTextFile | ( | const std::string & | fileName, | |
std::map< int, StringMap > & | text | |||
) |
Gobble up a text file into the map data structure. The words in the file can the be accessed via text[lineNumber][wordNumber]
Referenced by OptionsFiller::parseFileList(), OptionsFiller::parseIllumList(), and OptionsFiller::parseTableList().
void StringOps::split | ( | const std::string & | str, | |
char | sep, | |||
StringMap & | words | |||
) |
Split the "sentence" std::string into a list of "words" as delimited by the sep character.
Referenced by Table< DataType >::checkRange(), DataMethod< DataType >::determineDetectionSourceAndTarget(), DataMethod< DataType >::determineSourceAndTarget(), and extractSources().
void StringOps::splitDoublet | ( | const std::string & | str, | |
std::string & | value1, | |||
std::string & | value2 | |||
) |
Split a xx.yy std::string into xx and yy.
Referenced by insertFitsExtensionHeader(), and insertFitsPrimaryHeader().
std::string StringOps::ToLower | ( | const std::string & | str | ) |
Convert std::string to lower case.
Referenced by Moon< DataType >::calcMoonPosAndPhase(), Table< DataType >::checkData(), CalibratedVSAMagnitude< DataType >::doit2(), CalibratedMagnitude< DataType >::doit2(), FileName< DataType >::FileName(), getMethod(), ProgrammeTable::getProgrammeId(), FitsFile::initExpectedKeysList(), ProgrammeTable::loadData(), makeTargetList(), TelRunNum< DataType >::TelRunNum(), and FitsFile::testExpectedKeys().