OpendTect  7.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StringBuilder Class Reference

Builds a string by adding strings. Much faster than string manipulation. Only supports adding. More...

Public Types

typedef int size_type
 

Public Member Functions

 StringBuilder ()
 
 StringBuilder (const char *)
 
 StringBuilder (const StringBuilder &oth)
 
virtual ~StringBuilder ()
 
StringBuilderadd (char, size_type nr=1)
 
StringBuilderadd (const char *)
 
StringBuilderadd (const QString &)
 
template<class T >
StringBuilderadd (const T &t)
 
StringBuilderaddNewLine (size_type nr=1)
 
StringBuilderaddSpace (size_type nr=1)
 
StringBuilderaddTab (size_type nr=1)
 
char * getCStr (int minlen=-1)
 
bool isEmpty () const
 
bool operator!= (const StringBuilder &) const
 
StringBuilderoperator= (const char *s)
 
StringBuilderoperator= (const StringBuilder &)
 
bool operator== (const StringBuilder &) const
 
const char * result () const
 
StringBuilderset (const char *)
 
template<class T >
StringBuilderset (const T &)
 
StringBuildersetEmpty ()
 
const char * str () const
 

Protected Member Functions

bool setBufSz (size_type, bool cp_old)
 

Protected Attributes

char * buf_ = nullptr
 
size_type bufsz_ = 0
 
size_type curpos_ = 0
 

Detailed Description

Builds a string by adding strings. Much faster than string manipulation. Only supports adding.

<>

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ StringBuilder() [1/3]

StringBuilder::StringBuilder ( )
inline

◆ StringBuilder() [2/3]

StringBuilder::StringBuilder ( const StringBuilder oth)
inline

◆ StringBuilder() [3/3]

StringBuilder::StringBuilder ( const char *  )

◆ ~StringBuilder()

virtual StringBuilder::~StringBuilder ( )
inlinevirtual

Member Function Documentation

◆ add() [1/4]

StringBuilder& StringBuilder::add ( char  ,
size_type  nr = 1 
)

◆ add() [2/4]

StringBuilder& StringBuilder::add ( const char *  )

◆ add() [3/4]

StringBuilder& StringBuilder::add ( const QString &  )

◆ add() [4/4]

template<class T >
StringBuilder& StringBuilder::add ( const T &  t)
inline

◆ addNewLine()

StringBuilder& StringBuilder::addNewLine ( size_type  nr = 1)
inline

◆ addSpace()

StringBuilder& StringBuilder::addSpace ( size_type  nr = 1)
inline

◆ addTab()

StringBuilder& StringBuilder::addTab ( size_type  nr = 1)
inline

◆ getCStr()

char* StringBuilder::getCStr ( int  minlen = -1)

◆ isEmpty()

bool StringBuilder::isEmpty ( ) const
inline

◆ operator!=()

bool StringBuilder::operator!= ( const StringBuilder ) const

◆ operator=() [1/2]

StringBuilder& StringBuilder::operator= ( const char *  s)
inline

◆ operator=() [2/2]

StringBuilder& StringBuilder::operator= ( const StringBuilder )

◆ operator==()

bool StringBuilder::operator== ( const StringBuilder ) const

◆ result()

const char* StringBuilder::result ( ) const
inline

◆ set() [1/2]

StringBuilder& StringBuilder::set ( const char *  )

◆ set() [2/2]

template<class T >
StringBuilder& StringBuilder::set ( const T &  )

◆ setBufSz()

bool StringBuilder::setBufSz ( size_type  ,
bool  cp_old 
)
protected

◆ setEmpty()

StringBuilder& StringBuilder::setEmpty ( )

◆ str()

const char* StringBuilder::str ( ) const
inline

Member Data Documentation

◆ buf_

char* StringBuilder::buf_ = nullptr
protected

◆ bufsz_

size_type StringBuilder::bufsz_ = 0
protected

◆ curpos_

size_type StringBuilder::curpos_ = 0
protected

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