|
C++ main module for mmsd Package
1.0
|
this class describes a string More...
#include <CORE_String.h>


Public Member Functions | |
| CORE_String () | |
| create a string More... | |
| CORE_String (const tString &str) | |
| create a string More... | |
| ~CORE_String () | |
| deleter More... | |
| const char & | operator[] (int i) const |
| get the i-th element Assert in (i>-1) Assert in (i<size()); More... | |
| char & | operator[] (int i) |
| get the i-th element Assert in (i>-1) Assert in (i<size()); More... | |
| void | setString (const tString &str) |
| set the integer to i More... | |
| void | setString (const char *str) |
| set the integer to i More... | |
| tString | getString () const |
| get the string More... | |
| tString | toString () const |
| return the string associated to the string More... | |
| char * | toCharArray () const |
| turn the string into char array More... | |
| void | tokenize (const tString &separator) |
| tokenize the string with the separator More... | |
| void | tokenize () |
| tokenize the string More... | |
| int | getTokensCount () const |
| get the number of tokens More... | |
| int | getTokensNumber () const |
| get the number of tokens More... | |
| void | begin () |
| tBoolean | hasNextToken () const |
| return true if there is another token More... | |
| tString | nextToken () |
| return the next token More... | |
| tString | getToken (const int &index) |
| get the token at index More... | |
| void | replaceAll (const tString &strToReplace, const tString &str) |
| replace all instances of strToReplace by str More... | |
| void | replaceFirst (const tString &strToReplace, const tString &str) |
| replace first instance of strToReplace by str More... | |
| void | replaceLast (const tString &strToReplace, const tString &str) |
| replace last instance of strToReplace by str More... | |
| void | toUpper () |
| turn the string to upper case More... | |
| void | toLower () |
| turn the string to lower case More... | |
| tString::size_type | indexOf (const tString &v) const |
| return the first index of v fin this->mString More... | |
| tString::size_type | lastIndexOf (const tString &v) const |
| return the last index of v fin this->mString More... | |
| tString::size_type | getLastIndexOf (const tString &v) const |
| return the last index of v fin this->mString More... | |
| tString::size_type | indexOf (const tString &v, const tString::size_type &fromIndex) const |
| return the index of char v in this->mString from fromIndex index More... | |
| void | remove (const tString::size_type &from, const tString::size_type &to) |
| remove all the chars in from & to More... | |
| void | remove (const tString::size_type &index) |
| remove the char at index More... | |
| tString | substring (const tString::size_type &from, const tString::size_type &to) const |
| return the string between from & to indices from index is included, to is not More... | |
| tString | substring (const tString::size_type &from) const |
| return the string from index More... | |
| char | charAt (const int &index) const |
| return the char at index More... | |
| int | length () const |
| get the size of the size More... | |
| void | append (const tString &v) |
| append the string v to the string More... | |
| void | append (const char &v) |
| append the char v to the string More... | |
| void | trim () |
| trim More... | |
| void | getSharedPointer (SP::CORE_Object &p) |
| get the shared pointer of this class into p More... | |
| void | getSharedPointer (SPC::CORE_Object &p) const |
| get the shared pointer of this class into p More... | |
| tString | getClassName () const |
| return the class name of the object More... | |
| tString | getIdentityString () const |
| return the identity string of the object of the form className_at_address More... | |
| tString | getPointerAddress () const |
| return the identity string of the object More... | |
| template<class T > | |
| tBoolean | isInstanceOf () const |
| return true if the object is an instance of T More... | |
| virtual void | print () |
| print the class More... | |
| virtual ostream & | print (ostream &out) const |
| print the class More... | |
| virtual void | print (const tString &message) |
| print the class More... | |
| virtual void | print (const tInteger &str) |
| print More... | |
| virtual void | print (const tRelativeInteger &str) |
| print More... | |
| virtual void | print (const tReal &str) |
| print More... | |
| virtual void | print (const int &str) |
| print More... | |
Static Public Member Functions | |
| static SP::CORE_String | New () |
| create a class String More... | |
| static SP::CORE_String | New (const tString &str) |
| build an integer object More... | |
| static char * | stringToCharArray (const tString &str) |
| turn the string into char array More... | |
| static void | replaceAll (tString &inOutValue, const tString &strToReplace, const tString &str) |
| replace all instances of strToReplace by str More... | |
| static void | replaceFirst (tString &inOutValue, const tString &strToReplace, const tString &str) |
| replace first instance of strToReplace by str More... | |
| static void | replaceLast (tString &inOutValue, const tString &strToReplace, const tString &str) |
| replace last instance of strToReplace by str More... | |
| static int | getOccurencesNumber (const tString &str, const tString &occ) |
| get the number of occurence of the string More... | |
| static tString | toString (const tString &str, const int &len) |
| return the string associated to the string More... | |
| static void | toUpper (tString &s) |
| to upper More... | |
| static tString | toUpper (const tString &str) |
| turn the string to upper case More... | |
| static void | toLower (tString &s) |
| to lower More... | |
| static tString | toLower (const tString &str) |
| turn the string to upper case More... | |
| static tString | toString (const tFlag &c) |
| return the string representation of short c More... | |
| static tString | toString (const float &c) |
| return the string representation of float c More... | |
| static tString | toString (const double &c) |
| return the string representation of double c More... | |
| static tString | toString (const long double &c) |
| return the string representation of long double c More... | |
| static tString | toString (const int &c) |
| return the string representation of int c More... | |
| static tString | toString (const long &c) |
| return the string representation of long c More... | |
| static tString | toString (const long long &c) |
| return the string representation of long long c More... | |
| static tString | toString (const unsigned int &c) |
| return the string representation of unsigned int c More... | |
| static tString | toString (const unsigned long &c) |
| return the string representation of c More... | |
| static tString | toString (const unsigned long long &c) |
| return the string representation of unsigned long long c More... | |
| static tString | toString (const tBoolean &c) |
| return the string representation of boolean c More... | |
| static tString | boolean2String (const tBoolean &c) |
| return the string representation true or false of boolean c More... | |
| static tString | booleanToString (const tBoolean &c) |
| return the string representation true or false of boolean c More... | |
| static tBoolean | string2Boolean (const tString &c) |
| return the booleazn corresponding to string More... | |
| static tBoolean | stringToBoolean (const tString &c) |
| return the booleazn corresponding to string More... | |
| static tString | toString (tCharacter c) |
| return the string representation of char c More... | |
| static tString | toString (tComplex c) |
| return the string representation of complex c More... | |
| static tString | toString (tString c) |
| return the string representation of string c More... | |
| static tString | toString (const int &n, const long double *c) |
| return the string representation of long double c More... | |
| static void | parse (const tString &str, unsigned char &c) |
| parse unsigned char c in str More... | |
| static void | parse (const tString &str, short int &c) |
| parse short c in str More... | |
| static void | parse (const tString &str, unsigned short int &c) |
| parse short c in str More... | |
| static void | parse (const tString &str, int &c) |
| parse int c in str More... | |
| static void | parse (const tString &str, long &c) |
| parse long c in str More... | |
| static void | parse (const tString &str, long long &c) |
| parse long long c in str More... | |
| static void | parse (const tString &str, unsigned int &c) |
| parse unsigned int c in str More... | |
| static void | parse (const tString &str, unsigned long &c) |
| parse unsigned long c in str More... | |
| static void | parse (const tString &str, unsigned long long &c) |
| parse unsigned long long c in str More... | |
| static void | parse (const tString &str, bool &c) |
| parse boolean c in str More... | |
| static void | parse (const tString &str, char &c) |
| parse char c in str More... | |
| static void | parse (const tString &str, float &c) |
| parse float c in str More... | |
| static void | parse (const tString &str, double &c) |
| parse double c in str More... | |
| static void | parse (const tString &str, long double &c) |
| parse long double c in str More... | |
| static void | parse (const tString &str, tString &c) |
| parse tString c in str More... | |
| static void | parse (const tString &str, tComplex &c) |
| parse tComplex c in str More... | |
| static tString::size_type | getLastIndexOf (const tString &str, const tString &v) |
| return the last index of v fin this->mString More... | |
| static tString | keepOnlyFirstLines (const tString &str, const int &nLines, tBoolean &isTruncated) |
| keep only the first lines of parameter str More... | |
| static void | removeAll (tString &inOutStr, const tString &strToRemove) |
| remove the char at index More... | |
| static void | truncate (tString &text, const int &nLines, const int &nCharsByLine) |
| truncate the message with nLines of nChars More... | |
| static tString | substring (const tString &str, const tString::size_type &from, const tString::size_type &to) |
| return the string between from & to indices from index is included, to is not More... | |
| static void | trim (tString &str) |
| trim a string More... | |
| static int | readInteger (const tString &v) |
| read only integer characters More... | |
| static tReal | readReal (const tString &v) |
| read only real characters if not a real return 0 More... | |
| static tBoolean | isLetter (const char &v) |
| return if the char is a letter More... | |
| static tBoolean | isDigit (const char &v) |
| return if the char is a digit More... | |
| static tString | getClassName (const tString &identityString) |
| return the class name of the object using only the identity string More... | |
| template<class T > | |
| static tString | getTypeName () |
| get type name More... | |
| static tBoolean | is64Architecture () |
| return true if the machine is a 64 bits machine More... | |
| static tBoolean | is32Architecture () |
| return true if the machine is a 32 bits machine More... | |
| static tString | pointer2String (const void *obj) |
| return the string represantation of a pointer More... | |
| static void | setOutput (ostream &out) |
| set output More... | |
| static ostream & | getOutput () |
| get output More... | |
| static void | printObjectsInMemory () |
| print object in memory More... | |
| static ostream & | print (ostream &out, const tString &message) |
| print the class More... | |
| static void | outputPrint (const tString &message) |
Static Public Attributes | |
| static tBoolean | mIsMemoryTesting =false |
| indicator to store all classes created and deleted only for debuging version More... | |
Protected Member Functions | |
| void | setThis (SP::CORE_Object p) |
| set this weak shared pointer called toDoAfterThis setting method More... | |
| virtual void | setType (tString type) |
| set the type of the object More... | |
| virtual void | toDoAfterThisSetting () |
| method called after setThis() method this method can oly be called once. More... | |
this class describes a string
Attributes:
Associations:
To do for tokenizer:
int main(){ using namespace std; using namespace boost; string s = "This is, a test"; tokenizer<> tok(s); for(tokenizer<>::iterator beg=tok.begin(); beg!=tok.end();++beg){ cout << *beg << "\n"; } } #include <boost/tokenizer.hpp> #include <string> #include <iostream>
int main() { typedef boost::tokenizer<boost::char_separator<char>> tokenizer; std::string s = "Boost C++ Libraries"; boost::char_separator<char> sep{" "}; tokenizer tok{s, sep}; for (const auto &t : tok) std::cout << t << '
'; }
| CORE_String::CORE_String | ( | ) |
| CORE_String::CORE_String | ( | const tString & | str | ) |
create a string
| CORE_String::~CORE_String | ( | ) |
deleter
|
inline |
append the string v to the string
|
inline |
|
inline |
return the string representation true or false of boolean c
Referenced by booleanToString().

return the string representation true or false of boolean c
References boolean2String().

|
inline |
return the char at index
return the class name of the object using only the identity string
Referenced by UI_Class::createVector2D(), LAP_DoublePackedUpperMatrix::matrixProduct(), LAP_DoubleBandedUpperMatrix::matrixProduct(), LAP_DoubleFullUpperMatrix::matrixProduct(), and CORE_Object::printObjectsInMemory().

|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().

|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by UI_Class::createPrimitiveMap(), UI_Class::saveAssociation(), UI_Class::saveClass(), UI_ClassFactory::saveIntoClass(), MATH_StiefelFunction::toString(), LAP_2DView::toString(), CORE_Object::toString(), MATH_StiefelOptimizer::toString(), and MM_Class::toString().


|
inline |
return the last index of v fin this->mString
|
inlinestatic |
return the last index of v fin this->mString
get the number of occurence of the string
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().

|
inlineinherited |
get the shared pointer of this class into p
Referenced by CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< tFlag >::getSharedPointer(), LAP_ConstVector< lapack_real >::getSharedPointer(), STAT_Combinatorial< T >::getSharedPointer(), LAP_Vector< lapack_int >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), and CORE_Object::printObjectsInMemory().

|
inlineinherited |
get the shared pointer of this class into p
|
inline |
get the string
|
inline |
get the token at index
|
inline |
get the number of tokens
|
inline |
get the number of tokens
|
inlinestaticinherited |
get type name
References tString.
|
inline |
return true if there is another token
|
inline |
return the first index of v fin this->mString
Referenced by MM_Attribute::setValue().

|
inline |
return the index of char v in this->mString from fromIndex index
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().

|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().

|
inlinestatic |
return if the char is a digit
|
inlineinherited |
return true if the object is an instance of T
References null.
|
inlinestatic |
return if the char is a letter
|
static |
keep only the first lines of parameter str
| str | : string parameter to keep only nLines |
| nLines | : number of lines to keep |
| isTruncated | : is set to true if the string has been truncated |
References tString.
|
inline |
return the last index of v fin this->mString
Referenced by MMSD_DataSet::load(), MMSD_DataSet::save(), and MM_Attribute::setValue().

|
inline |
get the size of the size
Referenced by MMSD_DataSet::load(), MMSD_DataSet::save(), and MM_Attribute::setValue().

|
inlinestatic |
create a class String
References CORE_String().
Referenced by CORE_ClassFactory::NewInstance(), CORE_Color::setColor(), CORE_Time::setTime(), and CORE_Array< T >::setValues().


|
inlinestatic |
|
inline |
return the next token
|
inline |
get the i-th element Assert in (i>-1) Assert in (i<size());
|
inline |
get the i-th element Assert in (i>-1) Assert in (i<size());
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().


|
inlinestatic |
parse unsigned char c in str
References CORE_Integer::parseInt().
Referenced by readInteger(), readReal(), CORE_VectorReader::readVector(), and CORE_Array< T >::setValues().


|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
parse long long c in str
References CORE_Integer::parseInt().

|
inlinestatic |
parse unsigned int c in str
References CORE_Integer::parseInt().

|
inlinestatic |
parse unsigned long c in str
References CORE_Integer::parseInt().

|
inlinestatic |
parse unsigned long long c in str
References CORE_Integer::parseInt().

|
inlinestatic |
parse boolean c in str
References CORE_Integer::parseInt().

|
inlinestatic |
parse char c in str
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
parse long double c in str
References CORE_Real::parseReal().

parse tString c in str
References tString.
parse tComplex c in str
References CORE_Complex::parseComplex(), and tComplex.

|
staticinherited |
return the string represantation of a pointer
References tString.
Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().

|
inlinevirtualinherited |
print the class
References CORE_Object::toString().
Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().


|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().

|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().

|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().


|
static |
|
inline |
remove all the chars in from & to
|
inline |
remove the char at index
remove the char at index
replace all instances of strToReplace by str
|
static |
replace all instances of strToReplace by str
replace first instance of strToReplace by str
|
static |
replace first instance of strToReplace by str
replace last instance of strToReplace by str
|
static |
replace last instance of strToReplace by str
|
inlinestaticinherited |
set output
|
inline |
set the integer to i
|
inline |
set the integer to i
|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().

|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by LAP_IntegerVector::LAP_IntegerVector(), MATH_BetaFunction::MATH_BetaFunction(), MATH_C1Function::MATH_C1Function(), MATH_DigammaFunction::MATH_DigammaFunction(), MATH_EigenFunction::MATH_EigenFunction(), MATH_Equation::MATH_Equation(), MATH_Function::MATH_Function(), MATH_GammaFunction::MATH_GammaFunction(), MATH_KeplerFunction::MATH_KeplerFunction(), MATH_LogGammaFunction::MATH_LogGammaFunction(), MATH_NewtonEquation::MATH_NewtonEquation(), MATH_StiefelFunction::MATH_StiefelFunction(), MATH_StiefelOptimizer::MATH_StiefelOptimizer(), MATH_TranscendentEquation::MATH_TranscendentEquation(), MATH_TrigammaFunction::MATH_TrigammaFunction(), MATH_ZeroEquation::MATH_ZeroEquation(), MATH_ZKeplerFunction::MATH_ZKeplerFunction(), MM_Attribute::MM_Attribute(), MM_Class::MM_Class(), MM_ClassFactory::MM_ClassFactory(), MM_Data::MM_Data(), MM_Structure::MM_Structure(), MMSD_ClassFactory::MMSD_ClassFactory(), MMSD_Cluster::MMSD_Cluster(), MMSD_ConstDoubleVector::MMSD_ConstDoubleVector(), MMSD_ConstraintGaussianCluster::MMSD_ConstraintGaussianCluster(), MMSD_ConstraintGaussianModel::MMSD_ConstraintGaussianModel(), MMSD_DataSet::MMSD_DataSet(), MMSD_DataSetClassFactory::MMSD_DataSetClassFactory(), MMSD_DoubleFullMatrix::MMSD_DoubleFullMatrix(), MMSD_DoubleSymmetricMatrix::MMSD_DoubleSymmetricMatrix(), MMSD_DoubleVector::MMSD_DoubleVector(), MMSD_FluryGautschiGaussianLaw::MMSD_FluryGautschiGaussianLaw(), MMSD_GaussianCluster::MMSD_GaussianCluster(), MMSD_GaussianFDFunction::MMSD_GaussianFDFunction(), MMSD_GaussianLaw::MMSD_GaussianLaw(), MMSD_GaussianModel::MMSD_GaussianModel(), MMSD_Law::MMSD_Law(), MMSD_Model::MMSD_Model(), MMSD_ModelClassFactory::MMSD_ModelClassFactory(), MMSD_Object::MMSD_Object(), MMSD_StiefelFunction::MMSD_StiefelFunction(), MMSD_StiefelGaussianLaw::MMSD_StiefelGaussianLaw(), STAT_BernoulliDistribution::STAT_BernoulliDistribution(), STAT_BinomialDistribution::STAT_BinomialDistribution(), STAT_Combinatorial< T >::STAT_Combinatorial(), STAT_DiracDistribution::STAT_DiracDistribution(), STAT_Distribution::STAT_Distribution(), STAT_ExponentialDistribution::STAT_ExponentialDistribution(), STAT_GammaDistribution::STAT_GammaDistribution(), STAT_GeometricDistribution::STAT_GeometricDistribution(), STAT_InverseNormalDistribution::STAT_InverseNormalDistribution(), STAT_NormalDistribution::STAT_NormalDistribution(), STAT_Object::STAT_Object(), STAT_PoissonDistribution::STAT_PoissonDistribution(), STAT_UniformDistribution::STAT_UniformDistribution(), and STAT_UniformLaplaceTransform::STAT_UniformLaplaceTransform().

return the booleazn corresponding to string
Referenced by stringToBoolean().

return the booleazn corresponding to string
References string2Boolean().

|
static |
turn the string into char array
the return value must be delete by delete[] function.
Referenced by toCharArray().

|
inlinestatic |
return the string between from & to indices from index is included, to is not
Referenced by MMSD_DataSet::load(), MMSD_DataSet::save(), and MM_Attribute::setValue().

|
inline |
return the string between from & to indices from index is included, to is not
|
inline |
return the string from index
|
inline |
turn the string into char array
References stringToCharArray().

|
inlineprotectedvirtualinherited |
method called after setThis() method this method can oly be called once.
Reimplemented in STAT_UniformLaplaceTransform.
Referenced by CORE_Object::setThis(), and STAT_UniformLaplaceTransform::toDoAfterThisSetting().

|
inline |
tokenize the string with the separator
References tokenize().
Referenced by MM_Attribute::setValue().


| void CORE_String::tokenize | ( | ) |
tokenize the string
References tString.
Referenced by tokenize().

|
inlinestatic |
to lower
|
inline |
turn the string to lower case
Referenced by MMSD_DataSet::load(), MMSD_DataSet::save(), MMSD_Cluster::setWeightInitializationType(), and toLower().

|
inlinevirtual |
return the string associated to the string
Reimplemented from CORE_Object.
Referenced by append(), LAP_DoubleFullGeneralMatrix::computeEigenValueDecomposition(), LAP_DoubleFullGeneralMatrix::computeEigenValues(), DoubleBandedSymmetricMatrixBoundedEigenValues(), DoubleBandedSymmetricMatrixEigenValues(), DoubleFullSymmetricMatrixEigenValues(), DoubleFullUpperMatrixInverse(), DoublePackedSymmetricMatrixBoundedEigenValues(), DoublePackedSymmetricMatrixEigenValues(), CORE_Time::getDuration(), MM_Attribute::getValueToString(), LAP_DoubleFullGeneralMatrix::inverse(), MMSD_DataSet::load(), MMSD_Model::parametersOptimizationByEMMethod(), CORE_Array3D< T >::toString(), CORE_SharedPointersListVMap< Key, Value >::toString(), CORE_SharedPointersVMap< Key, Value >::toString(), CORE_Matrix< T >::toString(), toString(), CORE_Array2D< T >::toString(), LAP_DoubleMatrix::toString(), MM_Class::toString(), CORE_Array< T >::toString(), and CORE_Vector< T >::toString().

return the string associated to the string
References tString.
return the string representation of short c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of float c
References CORE_Real::toString().

|
inlinestatic |
return the string representation of double c
References CORE_Real::toString().

|
inlinestatic |
return the string representation of long double c
References CORE_Real::toString().

|
inlinestatic |
return the string representation of int c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of long c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of long long c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of unsigned int c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of c
References CORE_Integer::toString().

|
inlinestatic |
return the string representation of unsigned long long c
References CORE_Integer::toString().

return the string representation of boolean c
References toString().

|
inlinestatic |
return the string representation of char c
References tString.
return the string representation of complex c
References CORE_Complex::toString().

return the string representation of string c
|
inlinestatic |
return the string representation of long double c
References CORE_Real::toString(), and tString.

|
inlinestatic |
to upper
|
inline |
turn the string to upper case
Referenced by MMSD_ClassFactory::NewInstance(), MMSD_ModelClassFactory::NewInstance(), and toUpper().

|
static |
|
inline |
trim
Referenced by CORE_Real::parseReal(), and CORE_Run::readOptions().

|
static |
truncate the message with nLines of nChars
|
staticinherited |
indicator to store all classes created and deleted only for debuging version
Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().
1.8.8