Mantid
|
Holds support functions for strings. More...
Functions | |
MANTID_KERNEL_DLL int | confirmStr (const std::string &S, const std::string &fullPhrase) |
determine if a character group exists in a string More... | |
template<typename T > | |
int | convert (const char *A, T &out) |
Convert a char* into a number. More... | |
template<typename T > | |
int | convert (const std::string &A, T &out) |
Convert a string into a number. More... | |
template<typename T > | |
int | convPartNum (const std::string &A, T &out) |
Takes a character string and evaluates the first [typename T] object. More... | |
MANTID_KERNEL_DLL int | endsWithInt (const std::string &word) |
Get an int from the end of a word. More... | |
MANTID_KERNEL_DLL std::istream & | extractToEOL (std::istream &is, std::string &str) |
Extract a line from input stream, discarding any EOL characters encountered. More... | |
MANTID_KERNEL_DLL int | extractWord (std::string &Line, const std::string &Word, const int cnt=4) |
Get a word from a string. More... | |
template<typename T > | |
MANTID_KERNEL_DLL int | findComp (std::istream &, const boost::regex &, T &) |
Find a compmonent in a Regex in a file. More... | |
template<> | |
DLLExport int | findComp (std::istream &fh, const boost::regex &Re, std::string &Out) |
Finds the start of the tally. More... | |
template<typename T > | |
int | findComp (std::istream &fh, const boost::regex &Re, T &Out) |
Finds the start of the tally. More... | |
MANTID_KERNEL_DLL int | findPattern (std::istream &, const boost::regex &, std::string &) |
Finds a pattern in a file. More... | |
MANTID_KERNEL_DLL std::string | fullBlock (const std::string &A) |
strip pre/post spaces More... | |
MANTID_KERNEL_DLL std::string | getLine (std::istream &fh) |
Get a line and strip comments Use only for a single call. More... | |
MANTID_KERNEL_DLL void | getLine (std::istream &fh, std::string &Line) |
Get a line and strip comments Use within a loop. More... | |
MANTID_KERNEL_DLL int | getPartLine (std::istream &fh, std::string &Out, std::string &Excess, const int spc=256) |
get a part of a long line More... | |
float | getVAXnum (const float A) |
Convert a VAX number to x86 little eindien. More... | |
MANTID_KERNEL_DLL std::string | getWord (std::istream &in, bool consumeEOL) |
Returns the next word in the stream. More... | |
MANTID_KERNEL_DLL int | isEmpty (const std::string &A) |
Determines if a string is only spaces. More... | |
MANTID_KERNEL_DLL int | isMember (const std::vector< std::string > &group, const std::string &candidate) |
checks if the candidate is the member of the group More... | |
template<typename ITERATOR_TYPE > | |
DLLExport std::string | join (ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if<!(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type *=nullptr) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string. More... | |
template<typename ITERATOR_TYPE > | |
DLLExport std::string | join (ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if<(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type *=nullptr) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string. More... | |
template<typename ITERATOR_TYPE > | |
DLLExport std::string | joinCompress (ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator=",", const std::string &listSeparator="-") |
Join a set or vector of (something that turns into a string) together into one string, separated by a separator, adjacent items that are precisely 1 away from each other will be compressed into a list syntax e.g. More... | |
MANTID_KERNEL_DLL std::string | loadFile (const std::string &filename) |
Loads the entire contents of a text file into a string. More... | |
template<typename Integer > | |
std::vector< std::vector< Integer > > | parseGroups (const std::string &str) |
Parses unsigned integer groups, e.g. More... | |
MANTID_KERNEL_DLL std::vector< int > | parseRange (const std::string &str, const std::string &elemSep=",", const std::string &rangeSep="-") |
Parses a number range, e.g. More... | |
MANTID_KERNEL_DLL std::string | peekLine (std::istream &fh) |
Peek at a line without extracting it from the stream. More... | |
void | printHex (std::ostream &OFS, const int n) |
Function to convert a number into hex output (and leave the stream un-changed) More... | |
MANTID_KERNEL_DLL void | readToEndOfLine (std::istream &in, bool ConsumeEOL) |
Eat everything from the stream until the next EOL. More... | |
MANTID_KERNEL_DLL std::string | removeSpace (const std::string &CLine) |
strip all spaces More... | |
MANTID_KERNEL_DLL std::string | replace (const std::string &input, const std::string &find_what, const std::string &replace_with) |
Return a string with all matching occurence-strings. More... | |
MANTID_KERNEL_DLL std::string | replaceAll (const std::string &input, const std::string &charStr, const std::string &substitute) |
Return a string with all occurrences of the characters in the input replaced by the replace string. More... | |
template<typename T > | |
int | section (char *cA, T &out) |
Convert and cut a char*. More... | |
template<typename T > | |
int | section (std::string &A, T &out) |
Convert and cut a string. More... | |
template<typename T > | |
int | sectionMCNPX (std::string &A, T &out) |
Convert and cut a string for MCNPX. More... | |
template<typename T > | |
int | sectPartNum (std::string &A, T &out) |
Convert and cut a string. More... | |
template<typename T > | |
int | setValues (const std::string &Line, const std::vector< int > &Index, std::vector< T > &Out) |
Call to read in various values in position x1,x2,x3 from the line. More... | |
MANTID_KERNEL_DLL std::string | shorten (const std::string &input, const size_t max_length) |
Converts long strings into "start ... end". More... | |
template<typename ITERATOR_TYPE > | |
DLLExport std::string | simpleJoin (ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string. More... | |
MANTID_KERNEL_DLL bool | skipLine (const std::string &line) |
Determines if a string starts with a #. More... | |
MANTID_KERNEL_DLL size_t | split_path (const std::string &path, std::vector< std::string > &path_components) |
function parses a path, found in input string "path" and returns vector of the folders contributed into the path */ More... | |
MANTID_KERNEL_DLL std::map< std::string, std::string > | splitToKeyValues (const std::string &input, const std::string &keyValSep="=", const std::string &listSep=",") |
Splits a string into key value pairs. More... | |
template<typename T > | |
MANTID_KERNEL_DLL int | StrComp (const char *, const boost::regex &, T &, const int=0) |
Find if a pattern matches a string. More... | |
template<typename T > | |
int | StrComp (const char *Text, const boost::regex &Re, T &Aout, const int compNum) |
Find the match in regular expression and places number in Aout. More... | |
template<typename T > | |
MANTID_KERNEL_DLL int | StrComp (const std::string &, const boost::regex &, T &, const int=0) |
Find if a pattern matches. More... | |
template<typename T > | |
int | StrComp (const std::string &Text, const boost::regex &Re, T &Aout, const int compNum) |
Find the match in regular expression and places number in Aout. More... | |
template<typename T > | |
int | StrFullCut (std::string &, const boost::regex &, std::vector< T > &) |
Cut out the searched section and returns component. More... | |
template<typename T > | |
int | StrFullCut (std::string &, const boost::regex &, T &, const int=-1) |
Cut out the searched section and returns component. More... | |
template<> | |
int | StrFullCut (std::string &Text, const boost::regex &Re, std::vector< std::string > &Aout) |
Find the match, return the disected items: Then remove the whole of the match The regexpression must have one ( ) around the area to extract This is specialised for string and thus does not need a convert. More... | |
template<typename T > | |
int | StrFullSplit (const char *, const boost::regex &, std::vector< T > &) |
Split a line searched parts. More... | |
template<typename T > | |
int | StrFullSplit (const std::string &, const boost::regex &, std::vector< T > &) |
Split a line searched parts. More... | |
MANTID_KERNEL_DLL std::string | strip (const std::string &A) |
strip pre/post spaces More... | |
MANTID_KERNEL_DLL void | stripComment (std::string &A) |
strip trailling comments More... | |
std::string | stripMultSpc (const std::string &Line) |
Removes the multiple spaces in the line. More... | |
MANTID_KERNEL_DLL int | StrLook (const std::string &, const boost::regex &) |
Find is a pattern matches. More... | |
MANTID_KERNEL_DLL std::vector< std::string > | StrParts (const std::string &Ln) |
Split tring into spc deliminated components. More... | |
MANTID_KERNEL_DLL std::vector< std::string > | StrParts (std::string, const boost::regex &) |
Split a line into component parts. More... | |
template<typename T > | |
int | StrSingleSplit (const char *, const boost::regex &, std::vector< T > &) |
Split a line searched parts. More... | |
template<typename T > | |
int | StrSingleSplit (const std::string &, const boost::regex &, std::vector< T > &) |
Split a line searched parts. More... | |
template<> | |
int | StrSingleSplit (const std::string &text, const boost::regex &Re, std::vector< std::string > &Aout) |
Find the match, return the disected items The regexpression must have ( ) around the area to extract. More... | |
MANTID_KERNEL_DLL std::string | toLower (const std::string &input) |
Converts string to all lowercase. More... | |
template<typename T > | |
std::string | toString (const std::set< T > &value) |
Convert a set to a string. More... | |
template<> | |
MANTID_KERNEL_DLL std::string | toString (const std::vector< std::string > &value) |
Template overload for a vector of strings. More... | |
template<typename T > | |
std::string | toString (const std::vector< T > &value) |
Convert a vector to a string. More... | |
template<typename T > | |
std::string | toString (const T &value) |
Convert a number to a string. More... | |
template<> | |
MANTID_KERNEL_DLL std::string | toString (const UnitLabel &value) |
MANTID_KERNEL_DLL std::string | toUpper (const std::string &input) |
Converts string to all uppercase. More... | |
template<template< typename T, typename A > class V, typename T , typename A > | |
int | writeFile (const std::string &Fname, const T &step, const V< T, A > &Y) |
Write a set of containers to a file. More... | |
template<template< typename T, typename A > class V, typename T , typename A > | |
int | writeFile (const std::string &Fname, const V< T, A > &X, const V< T, A > &Y) |
Write out the three vectors into a file of type dc 9. More... | |
template<template< typename T, typename A > class V, typename T , typename A > | |
int | writeFile (const std::string &Fname, const V< T, A > &X, const V< T, A > &Y, const V< T, A > &Err) |
Write out the three container into a file with column free-formated data in the form : More... | |
MANTID_KERNEL_DLL void | writeMCNPX (const std::string &Line, std::ostream &OX) |
Write file in standard MCNPX input form. More... | |
Holds support functions for strings.
int Mantid::Kernel::Strings::confirmStr | ( | const std::string & | S, |
const std::string & | fullPhrase | ||
) |
determine if a character group exists in a string
Check to see if S is the same as the first part of a phrase.
(case insensitive)
S | :: string to check |
fullPhrase | :: complete phrase |
Definition at line 239 of file Strings.cpp.
int Mantid::Kernel::Strings::convert | ( | const char * | A, |
T & | out | ||
) |
Convert a char* into a number.
Convert a string into a value.
A | :: string to pass |
out | :: value if found |
Definition at line 689 of file Strings.cpp.
References convert().
int Mantid::Kernel::Strings::convert | ( | const std::string & | A, |
T & | out | ||
) |
Convert a string into a number.
Convert a string into a value.
A | :: string to pass |
out | :: value if found |
Definition at line 665 of file Strings.cpp.
References convert().
Referenced by Mantid::Algorithms::SetInstrumentParameter::addParameter(), Mantid::Algorithms::AddSampleLog::addSingleValueProperty(), Mantid::Algorithms::AddSampleLog::addTimeSeriesProperty(), convert(), Mantid::Algorithms::FilterEvents::copyNoneSplitLogs(), endsWithInt(), Mantid::Crystal::LoadIsawUB::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveIsawPeaks::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::SetGoniometer::exec(), Mantid::DataHandling::LoadIsawDetCal::exec(), Mantid::DataHandling::SaveIsawDetCal::exec(), Mantid::Kernel::FacilityInfo::fillMultiFileLimit(), Mantid::Kernel::FacilityInfo::fillZeroPadding(), Mantid::Kernel::InstrumentInfo::fillZeroPadding(), findComp(), Mantid::API::WorkspaceHistory::findHistoryEntries(), Mantid::API::BoxController::fromXMLString(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::getBanks(), Mantid::API::ExperimentInfo::getRunNumber(), Mantid::Algorithms::ConvertToConstantL2::getRunProperty(), Mantid::Kernel::ConfigServiceImpl::getValue(), Mantid::Algorithms::groupnumber(), Mantid::API::WorkspaceGroup::isMultiperiod(), Mantid::MDAlgorithms::SlicingAlgorithm::makeAlignedDimensionFromString(), Mantid::MDAlgorithms::SlicingAlgorithm::makeBasisVectorFromString(), Mantid::DataHandling::LoadSpice2D::parseDetectorDimensions(), Mantid::DataHandling::LoadHFIRSANS::parseDetectorDimensions(), Mantid::DataHandling::LoadGroupMapFile::parseFile(), parseRange(), Mantid::Geometry::SurfaceFactory::processLine(), Mantid::Geometry::CSGObject::procPair(), Mantid::DataObjects::PeakColumn< T >::read(), Mantid::Crystal::LoadIsawPeaks::readHeader(), Mantid::Crystal::LoadIsawUB::readModulatedUB(), Mantid::Algorithms::DetectorEfficiencyCorUser::retrieveProperties(), Mantid::Geometry::Plane::setSurface(), StrComp(), StrFullCut(), StrFullSplit(), StrSingleSplit(), and Mantid::Algorithms::SetInstrumentParameter::validateInputs().
int Mantid::Kernel::Strings::convPartNum | ( | const std::string & | A, |
T & | out | ||
) |
Takes a character string and evaluates the first [typename T] object.
The string is then erase upto the end of number. The diffierence between this and convert is that it allows trailing characters after the number.
out | :: place for output |
A | :: string to process |
number | of char read on success |
0 | on failure |
Definition at line 639 of file Strings.cpp.
Referenced by Mantid::Geometry::CSGObject::cellStr(), Mantid::Geometry::Acomp::processIntersection(), Mantid::Geometry::CSGObject::procString(), and Mantid::Geometry::Algebra::setFunctionObjStr().
int Mantid::Kernel::Strings::endsWithInt | ( | const std::string & | word | ) |
Get an int from the end of a word.
If a word ends with a number representing a positive integer, return the value of that int.
word | :: string possibly ending in a number |
Definition at line 210 of file Strings.cpp.
References convert().
Referenced by Mantid::DataObjects::Peak::setDetectorID().
std::istream & Mantid::Kernel::Strings::extractToEOL | ( | std::istream & | is, |
std::string & | str | ||
) |
Extract a line from input stream, discarding any EOL characters encountered.
Extract a string until an EOL character is reached.
There are 3 scenarios that we need to deal with 1) Windows-style - CRLF ('\r\n'); 2) Unix-style
is | :: The input stream to read from |
str | :: The output string to use to accumulate the line |
Definition at line 1137 of file Strings.cpp.
Referenced by Mantid::DataHandling::LoadTBL::confidence(), Mantid::DataHandling::LoadLog::countNumberColumns(), Mantid::Kernel::LogParser::createLogProperty(), Mantid::DataHandling::LoadTBL::exec(), Mantid::DataHandling::LoadLog::isOldDateTimeFormat(), Mantid::DataHandling::LoadLog::LoadSNSText(), Mantid::DataHandling::LoadLog::loadThreeColumnLogFile(), and Mantid::DataHandling::LoadLog::loadTwoColumnLogFile().
int Mantid::Kernel::Strings::extractWord | ( | std::string & | Line, |
const std::string & | Word, | ||
const int | cnt | ||
) |
Get a word from a string.
Checks that as least cnt letters of works is part of the string.
It is currently case sensitive. It removes the Word if found
Line | :: Line to process |
Word | :: Word to use |
cnt | :: Length of Word for significants [default =4] |
1 | on success (and changed Line) |
0 | on failure |
Definition at line 186 of file Strings.cpp.
MANTID_KERNEL_DLL int Mantid::Kernel::Strings::findComp | ( | std::istream & | fh, |
const boost::regex & | Re, | ||
T & | Out | ||
) |
Find a compmonent in a Regex in a file.
Find a compmonent in a Regex in a file.
fh | :: open file stream |
Re | :: regular expression to match |
Out | :: component in ( ) expression must be first. |
Definition at line 282 of file RegexStrings.cpp.
References convert().
DLLExport int Mantid::Kernel::Strings::findComp | ( | std::istream & | fh, |
const boost::regex & | Re, | ||
std::string & | Out | ||
) |
Finds the start of the tally.
fh | :: open file stream |
Re | :: regular expression to match |
Out | :: component in ( ) expression must be first. |
Definition at line 307 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::findComp | ( | std::istream & | fh, |
const boost::regex & | Re, | ||
T & | Out | ||
) |
Finds the start of the tally.
Find a compmonent in a Regex in a file.
fh | :: open file stream |
Re | :: regular expression to match |
Out | :: component in ( ) expression must be first. |
Definition at line 282 of file RegexStrings.cpp.
References convert().
DLLExport int Mantid::Kernel::Strings::findPattern | ( | std::istream & | fh, |
const boost::regex & | Re, | ||
std::string & | Out | ||
) |
Finds a pattern in a file.
Finds the start of the tally.
fh | :: open file stream |
Re | :: regular expression to match |
Out | :: string to place match |
Definition at line 259 of file RegexStrings.cpp.
std::string Mantid::Kernel::Strings::fullBlock | ( | const std::string & | A | ) |
strip pre/post spaces
Returns the string from the first non-space to the last non-space.
A | :: string to process |
Definition at line 389 of file Strings.cpp.
References strip().
std::string Mantid::Kernel::Strings::getLine | ( | std::istream & | fh | ) |
Get a line and strip comments Use only for a single call.
Reads a line from the stream of max length spc.
Trailing comments are removed. (with # or ! character)
fh | :: already open file handle |
Definition at line 319 of file Strings.cpp.
References getLine().
Referenced by getLine(), Mantid::DataHandling::PDLoadCharacterizations::readCharInfo(), Mantid::DataHandling::PDLoadCharacterizations::readExpIni(), Mantid::DataHandling::PDLoadCharacterizations::readFocusInfo(), Mantid::DataHandling::PDLoadCharacterizations::readVersion0(), and Mantid::DataHandling::PDLoadCharacterizations::readVersion1().
void Mantid::Kernel::Strings::getLine | ( | std::istream & | fh, |
std::string & | Line | ||
) |
Get a line and strip comments Use within a loop.
Reads a line from the stream of max length spc.
Trailing comments are removed. (with # or ! character)
fh | :: already open file handle |
Line | :: string read |
Definition at line 332 of file Strings.cpp.
int Mantid::Kernel::Strings::getPartLine | ( | std::istream & | fh, |
std::string & | Out, | ||
std::string & | Excess, | ||
const int | spc | ||
) |
get a part of a long line
Gets a line and determine if there is addition component to add in the case of a very long line.
fh | :: input stream to get line |
Out | :: string up to last 'tab' or ' ' |
Excess | :: string after 'tab or ' ' |
spc | :: number of char to try to read |
1 | :: more line to be found |
-1 | :: Error with file |
0 | :: line finished. |
Definition at line 262 of file Strings.cpp.
float Mantid::Kernel::Strings::getVAXnum | ( | const float | A | ) |
Convert a VAX number to x86 little eindien.
Converts a vax number into a standard unix number.
A | :: float number as read from a VAX file |
Definition at line 491 of file Strings.cpp.
std::string Mantid::Kernel::Strings::getWord | ( | std::istream & | in, |
bool | consumeEOL | ||
) |
Returns the next word in the stream.
Get a word from a line and strips spaces.
in | :: stream input |
consumeEOL | :: set to true to remove the new lines at the end of the line |
Definition at line 900 of file Strings.cpp.
References getWord().
Referenced by Mantid::Crystal::LoadIsawUB::exec(), Mantid::Crystal::SaveHKL::exec(), getWord(), Mantid::Crystal::LoadIsawUB::readModulatedUB(), and readToEndOfLine().
int Mantid::Kernel::Strings::isEmpty | ( | const std::string & | A | ) |
Determines if a string is only spaces.
A | :: string to check |
Definition at line 359 of file Strings.cpp.
Referenced by writeMCNPX().
int Mantid::Kernel::Strings::isMember | ( | const std::vector< std::string > & | group, |
const std::string & | candidate | ||
) |
checks if the candidate is the member of the group
Function checks if the candidate is the member of the group.
group | :: vector of string to check |
candidate | :: the string which has to be checked against the group |
Definition at line 1050 of file Strings.cpp.
Referenced by Mantid::MDAlgorithms::UnitsConversionHelper::analyzeUnitsConversion(), Mantid::MDAlgorithms::MDWSTransform::getQScaling(), and Mantid::MDAlgorithms::MDWSTransform::getTargetFrame().
DLLExport std::string Mantid::Kernel::Strings::join | ( | ITERATOR_TYPE | begin, |
ITERATOR_TYPE | end, | ||
const std::string & | separator, | ||
typename std::enable_if<!(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type * | = nullptr |
||
) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string.
Returns an empty string if the range is null. Does not add the separator after the LAST item.
For example, join a vector of strings with commas with: out = join(v.begin(), v.end(), ", ");
This version is used for random access iterators (e.g. map, set), and it calls simpleJoin().
begin | :: iterator at the start |
end | :: iterator at the end |
separator | :: string to append. |
Definition at line 84 of file Strings.h.
References join(), and simpleJoin().
Referenced by Mantid::Kernel::ConfigServiceImpl::appendDataSearchDir(), Mantid::ICat::ICat4Catalog::buildSearchQuery(), join(), parseRange(), Mantid::CurveFitting::Functions::CrystalFieldControl::parseStringListAttribute(), toString(), Mantid::API::BoxController::toXMLString(), Mantid::API::IFunction::writeToString(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().
DLLExport std::string Mantid::Kernel::Strings::join | ( | ITERATOR_TYPE | begin, |
ITERATOR_TYPE | end, | ||
const std::string & | separator, | ||
typename std::enable_if<(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type * | = nullptr |
||
) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string.
Returns an empty string if the range is null. Does not add the separator after the LAST item.
For example, join a vector of strings with commas with: out = join(v.begin(), v.end(), ", ");
This is a faster threaded version of the join() function above. It is used only if the iterators are not random access (e.g. vector), as it needs to be able to determine the distance between begin and end. It reverts to calling simpleJoin() if the input array is small.
begin | :: iterator at the start |
end | :: iterator at the end |
separator | :: string to append. |
Definition at line 111 of file Strings.h.
References join(), PARALLEL_GET_MAX_THREADS, PARALLEL_NUMBER_OF_THREADS, PARALLEL_THREAD_NUMBER, and simpleJoin().
DLLExport std::string Mantid::Kernel::Strings::joinCompress | ( | ITERATOR_TYPE | begin, |
ITERATOR_TYPE | end, | ||
const std::string & | separator = "," , |
||
const std::string & | listSeparator = "-" |
||
) |
Join a set or vector of (something that turns into a string) together into one string, separated by a separator, adjacent items that are precisely 1 away from each other will be compressed into a list syntax e.g.
1-5. Returns an empty string if the range is null. Does not add the separator after the LAST item.
For example, join a vector of strings with commas with: out = join(v.begin(), v.end(), ", ");
begin | :: iterator at the start |
end | :: iterator at the end |
separator | :: string to append between items. |
listSeparator | :: string to append between list items. |
std::string Mantid::Kernel::Strings::loadFile | ( | const std::string & | filename | ) |
Loads the entire contents of a text file into a string.
filename | :: full path to file |
Definition at line 28 of file Strings.cpp.
Referenced by Mantid::DataObjects::MDEventsTestHelper::createDiffractionEventWorkspace(), Mantid::DataHandling::LoadInstrument::exec(), Mantid::DataHandling::LoadGroupXMLFile::initializeXMLParser(), Mantid::DataHandling::LoadMask::initializeXMLParser(), Mantid::API::ExperimentInfo::loadInstrumentXML(), Mantid::DataHandling::LoadIDFFromNexus::readParameterCorrectionFile(), and MantidQt::MantidWidgets::SlitCalculator::setInstrument().
std::vector< std::vector< Integer > > Mantid::Kernel::Strings::parseGroups | ( | const std::string & | str | ) |
Parses unsigned integer groups, e.g.
"1+2,4-7,9,11" to a nested vector structure.
Definition at line 355 of file Strings.h.
References Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY, and Mantid::Kernel::StringTokenizer::TOK_TRIM.
std::vector< int > Mantid::Kernel::Strings::parseRange | ( | const std::string & | str, |
const std::string & | elemSep = "," , |
||
const std::string & | rangeSep = "-" |
||
) |
Parses a number range, e.g.
"1,4-9,54-111,3,10", to the vector containing all the elements within the range
"1,4-9,54-111,3,10", to the vector containing all the elements within the range.
str | String to parse |
elemSep | String with characters used to separate elements (',') |
rangeSep | String with characters used to separate range start and end ('-') |
Definition at line 1071 of file Strings.cpp.
References convert(), and join().
Referenced by Mantid::DataHandling::LoadGroupMapFile::parseFile(), Mantid::DataHandling::LoadGroupXMLFile::parseXML(), and Mantid::API::Grouping::toTable().
std::string Mantid::Kernel::Strings::peekLine | ( | std::istream & | fh | ) |
Peek at a line without extracting it from the stream.
Definition at line 344 of file Strings.cpp.
References strip().
Referenced by Mantid::DataHandling::LoadAscii::peekLine(), and Mantid::DataHandling::PDLoadCharacterizations::readFocusInfo().
void Mantid::Kernel::Strings::printHex | ( | std::ostream & | OFS, |
const int | n | ||
) |
Function to convert a number into hex output (and leave the stream un-changed)
OFS | :: Output stream |
n | :: Integer to convert |
Definition at line 138 of file Strings.cpp.
References n.
void Mantid::Kernel::Strings::readToEndOfLine | ( | std::istream & | in, |
bool | ConsumeEOL | ||
) |
Eat everything from the stream until the next EOL.
Read up to the eol.
in | :: stream input |
ConsumeEOL | :: set to true to remove the new lines at the end of the line |
Definition at line 951 of file Strings.cpp.
References getWord(), and readToEndOfLine().
Referenced by Mantid::Crystal::LoadIsawUB::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::LoadIsawUB::readModulatedUB(), and readToEndOfLine().
std::string Mantid::Kernel::Strings::removeSpace | ( | const std::string & | CLine | ) |
strip all spaces
Removes all spaces from a string except those with in the form '\ '.
CLine | :: Line to strip |
Definition at line 300 of file Strings.cpp.
Referenced by Mantid::Algorithms::FilterEvents::createOutputWorkspacesSplitters().
std::string Mantid::Kernel::Strings::replace | ( | const std::string & | input, |
const std::string & | find_what, | ||
const std::string & | replace_with | ||
) |
Return a string with all matching occurence-strings.
input | :: input string |
find_what | :: will search for all occurences of this string |
replace_with | :: ... and replace them with this. |
Definition at line 74 of file Strings.cpp.
Referenced by MantidQt::API::qtPluginPathFromCfg().
MANTID_KERNEL_DLL std::string Mantid::Kernel::Strings::replaceAll | ( | const std::string & | input, |
const std::string & | charStr, | ||
const std::string & | substitute | ||
) |
Return a string with all occurrences of the characters in the input replaced by the replace string.
input | :: The input string to perform the replacement on |
charStr | :: Each occurrence of ANY character in this string within the input string will be replaced by substitute |
substitute | :: A substitute string |
Definition at line 94 of file Strings.cpp.
Referenced by Mantid::DataHandling::CheckMantidVersion::cleanVersionTag(), and Mantid::Algorithms::PDDetermineCharacterizations::exec().
int Mantid::Kernel::Strings::section | ( | char * | cA, |
T & | out | ||
) |
Convert and cut a char*.
Takes a character string and evaluates the first [typename T] object.
The string is then filled with spaces upto the end of the [typename T] object
out | :: place for output |
cA | :: char array for input and output. |
Definition at line 553 of file Strings.cpp.
References section().
int Mantid::Kernel::Strings::section | ( | std::string & | A, |
T & | out | ||
) |
Convert and cut a string.
takes a character string and evaluates the first <T> object.
The string is then filled with spaces upto the end of the <T> object
out | :: place for output |
A | :: string for input and output. |
Definition at line 573 of file Strings.cpp.
Referenced by section(), Mantid::Geometry::Cone::setSurface(), Mantid::Geometry::Cylinder::setSurface(), Mantid::Geometry::General::setSurface(), Mantid::Geometry::Plane::setSurface(), Mantid::Geometry::Sphere::setSurface(), Mantid::Geometry::Torus::setSurface(), and setValues().
int Mantid::Kernel::Strings::sectionMCNPX | ( | std::string & | A, |
T & | out | ||
) |
Convert and cut a string for MCNPX.
Takes a character string and evaluates the first [T] object.
The string is then filled with spaces upto the end of the [T] object. This version deals with MCNPX numbers. Those are numbers that are crushed together like
out | :: place for output |
A | :: string for input and output. |
Definition at line 603 of file Strings.cpp.
int Mantid::Kernel::Strings::sectPartNum | ( | std::string & | A, |
T & | out | ||
) |
Convert and cut a string.
Takes a character string and evaluates the first [typename T] object.
The string is then erase upt to the end of number. The diffierence between this and section is that it allows trailing characters after the number.
out | :: place for output |
A | :: string to process |
Definition at line 527 of file Strings.cpp.
int Mantid::Kernel::Strings::setValues | ( | const std::string & | Line, |
const std::vector< int > & | Index, | ||
std::vector< T > & | Out | ||
) |
Call to read in various values in position x1,x2,x3 from the line.
Note to avoid the dependency on crossSort this needs to be call IN ORDER
Line | :: string to read |
Index | :: Indexes to read |
Out | :: OutValues [unchanged if not read] |
0 | :: success |
-ve | on failure. |
Definition at line 844 of file Strings.cpp.
std::string Mantid::Kernel::Strings::shorten | ( | const std::string & | input, |
const size_t | max_length | ||
) |
Converts long strings into "start ... end".
Return a string shortened with the center replace by " ... " If the string is already short enough then the original string will be returned.
If the max length or input string length is smaller than the ellipsis, the input will be returned.
input | :: input string |
max_length | :: The maximum length of the return string (0 = return full string) |
Definition at line 54 of file Strings.cpp.
Referenced by Mantid::Kernel::PropertyHistory::printSelf(), and Mantid::Kernel::Property::valueAsPrettyStr().
DLLExport std::string Mantid::Kernel::Strings::simpleJoin | ( | ITERATOR_TYPE | begin, |
ITERATOR_TYPE | end, | ||
const std::string & | separator | ||
) |
Join a set or vector of (something that turns into a string) together into one string, separated by a string.
Returns an empty string if the range is null. Does not add the separator after the LAST item.
For example, join a vector of strings with commas with: out = join(v.begin(), v.end(), ", ");
This is a simple default version that works in all cases but is potentially slow.
begin | :: iterator at the start |
end | :: iterator at the end |
separator | :: string to append. |
Definition at line 53 of file Strings.h.
Referenced by join().
bool Mantid::Kernel::Strings::skipLine | ( | const std::string & | line | ) |
Determines if a string starts with a #.
Return true if the line is to be skipped (starts with #).
line | :: The line to be checked |
Definition at line 408 of file Strings.cpp.
Referenced by Mantid::DataHandling::LoadAscii::skipLine().
size_t Mantid::Kernel::Strings::split_path | ( | const std::string & | path, |
std::vector< std::string > & | path_components | ||
) |
function parses a path, found in input string "path" and returns vector of the folders contributed into the path */
Function parses a path, placed into input string "path" and returns vector of the folders contributed into the path.
path | :: the string containing input path, found in path string, if they are separated by \ or / symbols. Treats special symbols, if defined in the input string as path-es returns 0 for empty input string |
path_components | :: holder for the individual folders in the path used to generate path in hdf file, so the resulting path has to obey hdf constrains; |
Definition at line 970 of file Strings.cpp.
std::map< std::string, std::string > Mantid::Kernel::Strings::splitToKeyValues | ( | const std::string & | input, |
const std::string & | keyValSep, | ||
const std::string & | listSep | ||
) |
Splits a string into key value pairs.
Splits a string into key value pairs and returns them as a map.
Whitespace between separators is ignored
input | :: The string containing the key/values |
keyValSep | :: The separator that splits a key and value [default: "="] |
listSep | :: The separator that splits elements of the list [default: ","] |
Definition at line 469 of file Strings.cpp.
References Mantid::Kernel::StringTokenizer::count(), Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY, and Mantid::Kernel::StringTokenizer::TOK_TRIM.
MANTID_KERNEL_DLL int Mantid::Kernel::Strings::StrComp | ( | const char * | Text, |
const boost::regex & | Re, | ||
T & | Aout, | ||
const int | compNum | ||
) |
Find if a pattern matches a string.
Find if a pattern matches a string.
Text | :: string to search |
Re | :: regular expression to use |
Aout | :: Place to put Unit found |
compNum | :: item to extract [0:N-1] |
Definition at line 48 of file RegexStrings.cpp.
References StrComp().
Referenced by StrComp().
int Mantid::Kernel::Strings::StrComp | ( | const char * | Text, |
const boost::regex & | Re, | ||
T & | Aout, | ||
const int | compNum | ||
) |
Find the match in regular expression and places number in Aout.
Find if a pattern matches a string.
Text | :: string to search |
Re | :: regular expression to use |
Aout | :: Place to put Unit found |
compNum | :: item to extract [0:N-1] |
Definition at line 48 of file RegexStrings.cpp.
References StrComp().
Referenced by StrComp().
MANTID_KERNEL_DLL int Mantid::Kernel::Strings::StrComp | ( | const std::string & | Text, |
const boost::regex & | Re, | ||
T & | Aout, | ||
const int | compNum | ||
) |
Find if a pattern matches.
Find if a pattern matches.
Text | :: string to search |
Re | :: regular expression to use |
Aout | :: Place to put Unit found |
compNum | :: item to extract [0:N-1] |
Definition at line 28 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::StrComp | ( | const std::string & | Text, |
const boost::regex & | Re, | ||
T & | Aout, | ||
const int | compNum | ||
) |
Find the match in regular expression and places number in Aout.
Find if a pattern matches.
Text | :: string to search |
Re | :: regular expression to use |
Aout | :: Place to put Unit found |
compNum | :: item to extract [0:N-1] |
Definition at line 28 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::StrFullCut | ( | std::string & | Text, |
const boost::regex & | Re, | ||
std::vector< T > & | Aout | ||
) |
Cut out the searched section and returns component.
Find the match, return the disected items: Then remove the whole of the match The regexpression must have one ( ) around the area to extract.
Text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: Values to extract |
0 | :: failed to match the string or there were no parts to match. |
1 | :: success |
Definition at line 121 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::StrFullCut | ( | std::string & | Text, |
const boost::regex & | Re, | ||
T & | Aout, | ||
const int | compNum | ||
) |
Cut out the searched section and returns component.
Find the match, return the disected items: Then remove the whole of the match The regexpression must have one ( ) around the area to extract.
Text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: Value to extract |
compNum | :: Index of matches [0->N-1] (-1 :: whole match) |
0 | :: failed to match the string or there were no parts to match. |
1 | :: success |
Definition at line 93 of file RegexStrings.cpp.
References convert().
int Mantid::Kernel::Strings::StrFullCut | ( | std::string & | Text, |
const boost::regex & | Re, | ||
std::vector< std::string > & | Aout | ||
) |
Find the match, return the disected items: Then remove the whole of the match The regexpression must have one ( ) around the area to extract This is specialised for string and thus does not need a convert.
Text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: Values to extract |
0 | :: failed to match the string or there were no parts to match. |
1 | :: success |
Definition at line 160 of file RegexStrings.cpp.
References index.
int Mantid::Kernel::Strings::StrFullSplit | ( | const char * | , |
const boost::regex & | , | ||
std::vector< T > & | |||
) |
Split a line searched parts.
int Mantid::Kernel::Strings::StrFullSplit | ( | const std::string & | text, |
const boost::regex & | Re, | ||
std::vector< T > & | Aout | ||
) |
Split a line searched parts.
Find the match, return the disected items The rege xpression must have ( ) around the area to extract.
The function appends the results onto Aout.
text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: vector to add components to. |
0 | :: failed to match the string or there were no parts to match. |
Number | :: number of components added to Aout. |
Definition at line 191 of file RegexStrings.cpp.
std::string Mantid::Kernel::Strings::strip | ( | const std::string & | A | ) |
strip pre/post spaces
Returns the string from the first non-space to the last non-space.
A | :: string to process |
Definition at line 397 of file Strings.cpp.
References strip().
Referenced by Mantid::DataHandling::CheckMantidVersion::cleanVersionTag(), Mantid::Geometry::InstrumentDefinitionParser::convertLocationsElement(), Mantid::MDAlgorithms::SlicingAlgorithm::createAlignedTransform(), Mantid::Algorithms::SetInstrumentParameter::exec(), Mantid::Crystal::SetGoniometer::exec(), Mantid::API::FileFinderImpl::findRun(), Mantid::API::FileFinderImpl::findRuns(), fullBlock(), Mantid::Kernel::ConfigServiceImpl::getFullPath(), Mantid::Kernel::getValueFromStdOut(), Mantid::API::Sample::loadNexus(), Mantid::MDAlgorithms::SlicingAlgorithm::makeAlignedDimensionFromString(), Mantid::MDAlgorithms::SlicingAlgorithm::makeBasisVectorFromString(), peekLine(), Mantid::MDAlgorithms::SlicingAlgorithm::processGeneralTransformProperties(), Mantid::DataHandling::PDLoadCharacterizations::readCharInfo(), Mantid::DataHandling::PDLoadCharacterizations::readExpIni(), Mantid::DataHandling::PDLoadCharacterizations::readFocusInfo(), Mantid::DataHandling::PDLoadCharacterizations::readVersion0(), Mantid::DataHandling::PDLoadCharacterizations::readVersion1(), Mantid::API::ExperimentInfo::setInstumentFromXML(), Mantid::Geometry::MDHistoDimensionBuilder::setName(), Mantid::API::FileProperty::setValue(), and strip().
void Mantid::Kernel::Strings::stripComment | ( | std::string & | A | ) |
strip trailling comments
removes the string after the comment type of '$ ' or '!' or '# '
A | :: String to process |
Definition at line 370 of file Strings.cpp.
std::string Mantid::Kernel::Strings::stripMultSpc | ( | const std::string & | Line | ) |
Removes the multiple spaces in the line.
Line | :: Line to process |
Definition at line 154 of file Strings.cpp.
int Mantid::Kernel::Strings::StrLook | ( | const std::string & | Text, |
const boost::regex & | Re | ||
) |
Find is a pattern matches.
Find the match in regular expression and return 1 if good match.
Text | :: string to match |
Re | :: regular expression to use |
Definition at line 58 of file RegexStrings.cpp.
Referenced by Mantid::Geometry::CSGObject::setObject().
std::vector< std::string > Mantid::Kernel::Strings::StrParts | ( | const std::string & | Ln | ) |
Split tring into spc deliminated components.
Splits the sting into parts that are space delminated.
Ln | :: line component to strip |
Definition at line 454 of file Strings.cpp.
References Mantid::Kernel::StringTokenizer::asVector(), Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY, and Mantid::Kernel::StringTokenizer::TOK_TRIM.
std::vector< std::string > Mantid::Kernel::Strings::StrParts | ( | std::string | Sdx, |
const boost::regex & | Re | ||
) |
Split a line into component parts.
Find the match, return the disected items.
Note it is complementary to support.h StrParts(Sdx)
Sdx | :: Input string (note implicit copy since altered) |
Re | :: Regular expression for separator component |
Definition at line 74 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::StrSingleSplit | ( | const char * | , |
const boost::regex & | , | ||
std::vector< T > & | |||
) |
Split a line searched parts.
int Mantid::Kernel::Strings::StrSingleSplit | ( | const std::string & | text, |
const boost::regex & | Re, | ||
std::vector< T > & | Aout | ||
) |
Split a line searched parts.
Find the match, return the disected items The regexpression must have ( ) around the area to extract.
The function appends the results onto Aout.
text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: vector to add components to. |
0 | :: failed to match the string or there were no parts to match. |
Number | :: number of components added to Aout. |
Definition at line 215 of file RegexStrings.cpp.
int Mantid::Kernel::Strings::StrSingleSplit | ( | const std::string & | text, |
const boost::regex & | Re, | ||
std::vector< std::string > & | Aout | ||
) |
Find the match, return the disected items The regexpression must have ( ) around the area to extract.
The function appends the results onto Aout.
text | :: string to split, is returned with the string after the find (if successful). |
Re | :: regular expression to use. |
Aout | :: vector to add components to. |
0 | :: failed to match the string or there were no parts to match. |
Number | :: number of components added to Aout. |
Definition at line 241 of file RegexStrings.cpp.
References index.
MANTID_KERNEL_DLL std::string Mantid::Kernel::Strings::toLower | ( | const std::string & | input | ) |
Converts string to all lowercase.
Convert all characters in string to lowercase.
Definition at line 116 of file Strings.cpp.
Referenced by Mantid::Kernel::FileDescriptor::initialize(), and Mantid::API::FileProperty::setLoadProperty().
std::string Mantid::Kernel::Strings::toString | ( | const std::set< T > & | value | ) |
Convert a set to a string.
Definition at line 741 of file Strings.cpp.
References toString(), and value.
MANTID_KERNEL_DLL std::string Mantid::Kernel::Strings::toString | ( | const std::vector< std::string > & | value | ) |
Template overload for a vector of strings.
value | :: A value to convert to a string. |
Definition at line 750 of file Strings.cpp.
References join(), toString(), and value.
std::string Mantid::Kernel::Strings::toString | ( | const std::vector< T > & | value | ) |
Convert a vector to a string.
This assumes that the vector is sorted.
value | :: templated value (only works for integer types) to convert. |
Definition at line 715 of file Strings.cpp.
References toString(), and value.
std::string Mantid::Kernel::Strings::toString | ( | const T & | value | ) |
Convert a number to a string.
Convert a number or other value to a string.
value | :: templated value (e.g. a double) to convert |
Definition at line 703 of file Strings.cpp.
References toString(), and value.
Referenced by Mantid::ICat::ICat4Catalog::buildSearchQuery(), Mantid::MDAlgorithms::CompareMDWorkspaces::compareMDGeometry(), Mantid::MDAlgorithms::CompareMDWorkspaces::compareMDHistoWorkspaces(), Mantid::DataHandling::LoadTOFRawNexus::countPixels(), Mantid::MDAlgorithms::MergeMD::createOutputWorkspace(), Mantid::MDAlgorithms::SaveMD::doSaveHisto(), Mantid::MDAlgorithms::SaveMD2::doSaveHisto(), Mantid::Algorithms::AddLogDerivative::exec(), Mantid::Crystal::MaskPeaksWorkspace::exec(), Mantid::Crystal::PeakIntensityVsRadius::exec(), Mantid::Crystal::SetGoniometer::exec(), Mantid::MDAlgorithms::SaveZODS::exec(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::getBanks(), Mantid::MDAlgorithms::MDNorm::getBinParameters(), Mantid::MDAlgorithms::QueryMDWorkspace::getBoxData(), MantidQt::MantidWidgets::FunctionModelSpectra::getString(), Mantid::API::Grouping::Grouping(), Mantid::MDAlgorithms::MDNorm::init(), Mantid::MDAlgorithms::MDNormDirectSC::init(), Mantid::MDAlgorithms::MDNormSCD::init(), Mantid::API::BoxControllerSettingsAlgorithm::initBoxControllerProps(), Mantid::MDAlgorithms::SlicingAlgorithm::initSlicingProps(), Mantid::DataObjects::MDBoxFlatTree::loadExperimentInfos(), Mantid::API::WorkspaceHistory::loadNestedHistory(), Mantid::API::Sample::loadNexus(), Mantid::Geometry::Goniometer::loadNexus(), Mantid::MDAlgorithms::SlicingAlgorithm::makeBasisVectorFromString(), Mantid::Algorithms::AddLogDerivative::makeDerivative(), Mantid::MDAlgorithms::SlicingAlgorithm::processGeneralTransformProperties(), Mantid::API::Algorithm::processGroups(), Mantid::API::MultiPeriodGroupWorker::processGroups(), Mantid::DataObjects::MDBoxFlatTree::saveExperimentInfos(), Mantid::API::Sample::saveNexus(), Mantid::Geometry::Goniometer::saveNexus(), Mantid::API::BoxControllerSettingsAlgorithm::setBoxController(), toString(), Mantid::MDAlgorithms::MDNorm::validateInputs(), and Mantid::MDAlgorithms::versus().
MANTID_KERNEL_DLL std::string Mantid::Kernel::Strings::toString | ( | const UnitLabel & | value | ) |
Definition at line 745 of file Strings.cpp.
References toString(), and value.
MANTID_KERNEL_DLL std::string Mantid::Kernel::Strings::toUpper | ( | const std::string & | input | ) |
Converts string to all uppercase.
Convert all characters in string to uppercase.
Definition at line 124 of file Strings.cpp.
Referenced by Mantid::API::FileProperty::setLoadProperty().
int Mantid::Kernel::Strings::writeFile | ( | const std::string & | Fname, |
const T & | step, | ||
const V< T, A > & | Y | ||
) |
Write a set of containers to a file.
Write out the three vectors into a file of type dc 9.
step | :: parameter to control x-step (starts from zero) |
Y | :: Y column |
Fname | :: Name of the file |
Definition at line 763 of file Strings.cpp.
References writeFile(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by writeFile().
int Mantid::Kernel::Strings::writeFile | ( | const std::string & | Fname, |
const V< T, A > & | X, | ||
const V< T, A > & | Y | ||
) |
Write out the three vectors into a file of type dc 9.
X | :: X column |
Y | :: Y column |
Fname | :: Name of the file |
Definition at line 781 of file Strings.cpp.
References writeFile(), Mantid::Geometry::X, and Mantid::Geometry::Y.
int Mantid::Kernel::Strings::writeFile | ( | const std::string & | Fname, |
const V< T, A > & | X, | ||
const V< T, A > & | Y, | ||
const V< T, A > & | Err | ||
) |
Write out the three container into a file with column free-formated data in the form :
X | :: X column |
Y | :: Y column |
Err | :: Err column |
Fname | :: Name of the file |
Definition at line 799 of file Strings.cpp.
References Mantid::Geometry::X, and Mantid::Geometry::Y.
void Mantid::Kernel::Strings::writeMCNPX | ( | const std::string & | Line, |
std::ostream & | OX | ||
) |
Write file in standard MCNPX input form.
Write out the line in the limited form for MCNPX ie initial line from 0->72 after that 8 to 72 (split on a space or comma)
Line | :: full MCNPX line |
OX | :: ostream to write to |
Definition at line 421 of file Strings.cpp.
References isEmpty(), and Mantid::Geometry::X.
Referenced by Mantid::Geometry::CSGObject::write(), Mantid::Geometry::Cone::write(), Mantid::Geometry::Cylinder::write(), Mantid::Geometry::Plane::write(), Mantid::Geometry::Quadratic::write(), Mantid::Geometry::Sphere::write(), and Mantid::Geometry::Torus::write().