#include <alizeString.h>


Public Member Functions | |
| String (const char *="") | |
| String (const String &) | |
| String & | duplicate () const |
| const String & | operator= (const String &) |
| const String & | operator= (const char *) |
| String & | operator+= (const String &) |
| String & | operator+= (const char *) |
| bool | operator== (const String &) const |
| bool | operator!= (const String &) const |
| bool | operator== (const char *) const |
| bool | operator!= (const char *) const |
| bool | operator< (const String &) const |
| bool | operator<= (const String &) const |
| bool | operator> (const String &) const |
| bool | operator>= (const String &) const |
| String | operator+ (const String &) const |
| String | operator+ (const char *) const |
| String | operator[] (unsigned long index) const |
| virtual | ~String () |
| double | toDouble () const |
| bool | toBool () const |
| long | toLong () const |
| unsigned long | toULong () const |
| unsigned long | length () const |
| void | reset () |
| bool | isEmpty () const |
| bool | endsWith (const String &) const |
| bool | beginsWith (const String &) const |
| String | getToken (unsigned long index, const String &sep=" ") const |
| long | find (const String &s, unsigned long start=0) const |
| const char * | c_str () const |
| virtual String | getClassName () const |
| virtual String | toString () const |
Static Public Member Functions | |
| static String | valueOf (unsigned long v) |
| static String | valueOf (long v) |
| static String | valueOf (unsigned int v) |
| static String | valueOf (int v) |
| static String | valueOf (double v) |
| static String | valueOf (bool v) |
Private Member Functions | |
| void | create (unsigned long length, unsigned long capacity, const char *) |
Private Attributes | |
| char * | _string |
| Internal c-style string (an array of char ended by a 0). | |
| unsigned long | _capacity |
| unsigned long | _length |
Friends | |
| class | TestString |
The String class represents character strings.
Definition at line 79 of file alizeString.h.
| S::String | ( | const char * | c = "" ) |
Definition at line 74 of file alizeString.cpp.
| S::String | ( | const String & | s ) |
Definition at line 81 of file alizeString.cpp.
| S::~String | ( | ) | [virtual] |
Definition at line 434 of file alizeString.cpp.
References NULL.
| bool S::beginsWith | ( | const String & | s ) | const |
Tests whether this string begins with the specified prefix
Definition at line 323 of file alizeString.cpp.
References _length, and _string.
Referenced by alize::AudioFileReader::getExt(), alize::FeatureFileWriter::getFullFileName(), alize::AudioFileReader::getPath(), and alize::AudioFileReader::readParams().
| const char * String::c_str | ( | ) | const |
Returns the string representation of the argument.
Definition at line 415 of file alizeString.cpp.
References _string.
Referenced by getToken(), alize::ULongVector::load(), alize::Histo::load(), alize::Matrix< T >::loadDB(), alize::FileWriter::open(), operator<<(), alize::Matrix< T >::randomInit(), alize::XList::save(), alize::ULongVector::save(), alize::Histo::save(), alize::Matrix< T >::saveDB(), alize::Histo::saveGnuplot(), alize::FeatureFlags::set(), and valueOf().
| void S::create | ( | unsigned long | length, |
| unsigned long | capacity, | ||
| const char * | c | ||
| ) | [private] |
Definition at line 424 of file alizeString.cpp.
Referenced by String().
| S & S::duplicate | ( | ) | const |
Definition at line 87 of file alizeString.cpp.
Referenced by alize::XLine::addElement(), alize::LabelSet::addLabel(), alize::XLine::getElements(), alize::LabelSet::LabelSet(), alize::LabelSet::operator=(), and alize::XLine::XLine().
| bool S::endsWith | ( | const String & | s ) | const |
Tests whether this string ends with the specified suffix
Definition at line 312 of file alizeString.cpp.
References _length, and _string.
Referenced by alize::ConfigFileReaderXml::eventClosingElement(), alize::ConfigFileReaderXml::eventOpeningElement(), alize::SegServer::load(), alize::Config::load(), and alize::ConfigFileWriter::writeConfig().
| long S::find | ( | const String & | s, |
| unsigned long | start = 0 |
||
| ) | const |
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
| s | the substring to find |
| start | the position from which to start the search. |
Definition at line 334 of file alizeString.cpp.
| String S::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 417 of file alizeString.cpp.
Finds the token number 'index' in this string
Example : string = " aaa bbb ccc "
getToken(0) will return "aaa"
getToken(1) will return "bbb"
getToken(2) will return "ccc"
getToken(3 and more) will return ""
| index | index of the token to return |
| sep | Separator. A single character. Default is " ". |
Definition at line 353 of file alizeString.cpp.
References c_str(), and length().
Referenced by alize::ConfigChecker::check(), alize::ConfigChecker::checkName(), alize::ConfigFileReaderXml::eventClosingElement(), alize::ConfigFileReaderRaw::readConfig(), alize::XListFileReader::readList(), alize::AudioFileReader::readParams(), and alize::Config::setParam().
| bool S::isEmpty | ( | ) | const |
Tests whether this string is equal to ""
Definition at line 310 of file alizeString.cpp.
Referenced by alize::FileWriter::open(), alize::ConfigFileReaderRaw::readConfig(), and alize::Config::setParam().
| unsigned long String::length | ( | ) | const |
Returns the length of this string
Definition at line 297 of file alizeString.cpp.
References _length.
Referenced by alize::ConfigChecker::getParamList(), getToken(), alize::XListFileReader::readList(), alize::Config::setParam(), and String().
| bool S::operator!= | ( | const char * | s ) | const |
Definition at line 272 of file alizeString.cpp.
| bool S::operator!= | ( | const String & | s ) | const |
Definition at line 262 of file alizeString.cpp.
References _string.
Definition at line 243 of file alizeString.cpp.
| S S::operator+ | ( | const char * | s ) | const |
Definition at line 250 of file alizeString.cpp.
Definition at line 215 of file alizeString.cpp.
| S & S::operator+= | ( | const char * | s ) |
Definition at line 229 of file alizeString.cpp.
| bool S::operator< | ( | const String & | s ) | const |
Definition at line 277 of file alizeString.cpp.
References _string.
| bool S::operator<= | ( | const String & | s ) | const |
Definition at line 282 of file alizeString.cpp.
References _string.
Definition at line 176 of file alizeString.cpp.
| const S & S::operator= | ( | const char * | s ) |
Definition at line 195 of file alizeString.cpp.
| bool S::operator== | ( | const char * | s ) | const |
Definition at line 267 of file alizeString.cpp.
| bool S::operator== | ( | const String & | s ) | const |
Definition at line 257 of file alizeString.cpp.
References _string.
| bool S::operator> | ( | const String & | s ) | const |
Definition at line 287 of file alizeString.cpp.
References _string.
| bool S::operator>= | ( | const String & | s ) | const |
Definition at line 292 of file alizeString.cpp.
References _string.
| S S::operator[] | ( | unsigned long | index ) | const |
Definition at line 299 of file alizeString.cpp.
| void S::reset | ( | ) |
The string becomes empty
Definition at line 308 of file alizeString.cpp.
Referenced by alize::Label::reset().
| bool S::toBool | ( | ) | const |
Converts this string into a boolean value
Definition at line 143 of file alizeString.cpp.
Referenced by alize::ConfigChecker::check(), alize::Config::getBooleanParam(), and alize::Config::setParam().
| double S::toDouble | ( | ) | const |
Converts this string into a double value
Definition at line 131 of file alizeString.cpp.
Referenced by alize::ConfigChecker::check(), alize::Config::getFloatParam(), alize::Matrix< T >::loadDT(), and alize::Config::setParam().
| long S::toLong | ( | ) | const |
Converts this string into a long value
Definition at line 154 of file alizeString.cpp.
Referenced by alize::ConfigChecker::check(), alize::Config::getIntegerParam(), alize::Matrix< T >::loadDT(), and alize::AudioFileReader::readParams().
| String S::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Definition at line 419 of file alizeString.cpp.
References alize::Object::toString().
| unsigned long S::toULong | ( | ) | const |
Converts this string into an unsigned long value
Definition at line 165 of file alizeString.cpp.
Referenced by alize::Config::setParam().
| S S::valueOf | ( | bool | v ) | [static] |
Definition at line 129 of file alizeString.cpp.
| S S::valueOf | ( | double | v ) | [static] |
Definition at line 108 of file alizeString.cpp.
References c_str().
| S S::valueOf | ( | unsigned int | v ) | [static] |
Definition at line 115 of file alizeString.cpp.
References c_str().
| S S::valueOf | ( | long | v ) | [static] |
Definition at line 101 of file alizeString.cpp.
References c_str().
| S S::valueOf | ( | int | v ) | [static] |
Definition at line 122 of file alizeString.cpp.
References c_str().
| S S::valueOf | ( | unsigned long | v ) | [static] |
Definition at line 94 of file alizeString.cpp.
References c_str().
Referenced by alize::FrameAcc::accumulate(), alize::MixtureGF::addDistrib(), alize::MixtureGD::addDistrib(), alize::DistribGF::computeLK(), alize::DistribGD::computeLK(), alize::FrameAcc::deaccumulate(), alize::ConfigFileReaderXml::eventError(), alize::SegServer::getClusterById(), alize::Feature::operator=(), alize::DistribGF::operator=(), alize::DistribGD::operator=(), alize::AudioFileReader::readFrame(), alize::SegServer::setClusterId(), alize::MixtureGF::setDistrib(), alize::MixtureGD::setDistrib(), alize::Seg::split(), alize::ViterbiAccum::toString(), alize::ULongVector::toString(), alize::SegServer::toString(), alize::SegCluster::toString(), alize::Seg::toString(), alize::MixtureGF::toString(), alize::MixtureGD::toString(), alize::Distrib::toString(), alize::LKVector::toString(), alize::LabelSet::toString(), alize::Histo::toString(), alize::FeatureFlags::toString(), alize::Feature::toString(), alize::IndexOutOfBoundsException::toString(), alize::Exception::toString(), alize::DoubleSquareMatrix::toString(), alize::DistribGF::toString(), alize::DistribGD::toString(), alize::AudioFrame::toString(), alize::AudioFileReader::toString(), alize::RealVector< float >::toString(), and alize::FileWriter::writeAttribute().
friend class TestString [friend] |
Definition at line 81 of file alizeString.h.
unsigned long alize::String::_capacity [private] |
Definition at line 204 of file alizeString.h.
unsigned long alize::String::_length [private] |
Definition at line 205 of file alizeString.h.
Referenced by beginsWith(), endsWith(), find(), length(), operator+=(), operator=(), and String().
char* alize::String::_string [private] |
Internal c-style string (an array of char ended by a 0).
Definition at line 203 of file alizeString.h.
Referenced by beginsWith(), c_str(), endsWith(), find(), operator!=(), operator+=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and String().
1.7.2