OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OD::String Class Referenceabstract

encapsulates the read-access-only part of strings in OD. More...

Inheritance diagram for OD::String:
[legend]

Public Member Functions

virtual ~String ()
 
bool operator== (const String &) const
 
bool operator!= (const String &) const
 
bool operator== (const char *) const
 
bool operator!= (const char *) const
 
template<class T >
bool operator== (const T &) const
 
template<class T >
bool operator!= (const T &t) const
 
const char * buf () const
 
const char * str () const
 
 operator const char * () const
 
unsigned int size () const
 
bool isEmpty () const
 
const char & operator[] (int idx) const
 
virtual char firstChar () const
 
bool isEqual (const char *, CaseSensitivity c=CaseSensitive) const
 
bool isStartOf (const char *, CaseSensitivity c=CaseSensitive) const
 
bool startsWith (const char *, CaseSensitivity c=CaseSensitive) const
 
bool isEndOf (const char *, CaseSensitivity c=CaseSensitive) const
 
bool endsWith (const char *, CaseSensitivity c=CaseSensitive) const
 
bool matches (const char *, CaseSensitivity c=CaseSensitive) const
 
bool contains (char) const
 
bool contains (const char *) const
 
const char * find (char) const
 
const char * findLast (char) const
 
const char * find (const char *) const
 
const char * findLast (const char *) const
 
unsigned int count (char) const
 
unsigned int getLevenshteinDist (const char *, bool casesens) const
 
bool isNumber (bool int_only=false) const
 
bool isYesNo () const
 
int toInt () const
 
float toFloat () const
 
double toDouble () const
 
bool toBool () const
 
bool operator> (const char *) const
 
bool operator< (const char *) const
 
template<class T >
bool operator> (const T &) const
 
template<class T >
bool operator< (const T &) const
 

Static Public Member Functions

static const Stringempty ()
 

Protected Member Functions

virtual const char * gtBuf () const =0
 
virtual const char * gtStr () const =0
 

Detailed Description

encapsulates the read-access-only part of strings in OD.

buf() always returns a valid null-terminated string. str() is the opposite: it always returns null if the string is empty

Constructor & Destructor Documentation

virtual OD::String::~String ( )
inlinevirtual

Member Function Documentation

const char* OD::String::buf ( ) const
inline
bool OD::String::contains ( char  ) const
bool OD::String::contains ( const char *  ) const
unsigned int OD::String::count ( char  ) const
static const String& OD::String::empty ( )
static
bool OD::String::endsWith ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
const char* OD::String::find ( char  ) const
const char* OD::String::find ( const char *  ) const
const char* OD::String::findLast ( char  ) const
const char* OD::String::findLast ( const char *  ) const
virtual char OD::String::firstChar ( ) const
inlinevirtual

Reimplemented in FixedString.

unsigned int OD::String::getLevenshteinDist ( const char *  ,
bool  casesens 
) const
virtual const char* OD::String::gtBuf ( ) const
protectedpure virtual
Returns
empty even if underlying is null

Implemented in BufferString, and FixedString.

virtual const char* OD::String::gtStr ( ) const
protectedpure virtual
Returns
null if empty

Implemented in BufferString, and FixedString.

bool OD::String::isEmpty ( ) const
inline
bool OD::String::isEndOf ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
bool OD::String::isEqual ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
bool OD::String::isNumber ( bool  int_only = false) const
bool OD::String::isStartOf ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
bool OD::String::isYesNo ( ) const
bool OD::String::matches ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
OD::String::operator const char * ( ) const
inline
bool OD::String::operator!= ( const String s) const
inline
bool OD::String::operator!= ( const char *  s) const
inline
template<class T >
bool OD::String::operator!= ( const T &  t) const
inline
bool OD::String::operator< ( const char *  ) const
template<class T >
bool OD::String::operator< ( const T &  t) const
inline
bool OD::String::operator== ( const String s) const
inline
bool OD::String::operator== ( const char *  s) const
inline
template<class T >
bool OD::String::operator== ( const T &  t) const
inline
bool OD::String::operator> ( const char *  ) const
template<class T >
bool OD::String::operator> ( const T &  t) const
inline
const char& OD::String::operator[] ( int  idx) const
inline
unsigned int OD::String::size ( ) const
bool OD::String::startsWith ( const char *  ,
CaseSensitivity  c = CaseSensitive 
) const
const char* OD::String::str ( ) const
inline
bool OD::String::toBool ( ) const
double OD::String::toDouble ( ) const
float OD::String::toFloat ( ) const
int OD::String::toInt ( ) const

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019