OpendTect  6.6
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SeparStringSB Class Reference

List encoded in a string. More...

Public Member Functions

 SeparStringSB (const char *escapedstr=nullptr, char separ=',')
 
 SeparStringSB (const SeparStringSB &ss)
 
SeparStringSBadd (const BufferStringSet &)
 Concatenation. More...
 
SeparStringSBadd (const char *unescapedstr)
 
SeparStringSBadd (const DBKey &, bool withsurvloc=true)
 
SeparStringSBadd (const OD::String &ods)
 
SeparStringSBadd (const SeparStringSB &)
 Concatenation. More...
 
template<class T >
SeparStringSBadd (T t)
 
const char * buf () const
 Output escaped. More...
 
FixedString from (int) const
 Output escaped. More...
 
char * getCStr ()
 Output escaped. More...
 
double getDValue (int) const
 
float getFValue (int) const
 
short getI16Value (int) const
 
int64_t getI64Value (int) const
 
int getIValue (int) const
 
unsigned short getUI16Value (int) const
 
uint64_t getUI64Value (int) const
 
unsigned int getUIValue (int) const
 
bool getYN (int) const
 
int indexOf (const char *unescapedstr) const
 
bool isEmpty () const
 
 operator const char * () const
 
template<class T >
SeparStringSBoperator+= (const OD::String &ods)
 
template<class T >
SeparStringSBoperator+= (T t)
 
SeparStringSBoperator= (const char *escapedstr)
 
SeparStringSBoperator= (const SeparStringSB &)
 
FixedString operator[] (int) const
 Output unescaped. More...
 
StringBuilderrep ()
 Output escaped. More...
 
char sepChar () const
 
const char * sepStr () const
 
SeparStringSBset (const BufferStringSet &bss)
 
SeparStringSBset (const char *unescapedstr)
 
SeparStringSBset (const OD::String &ods)
 
SeparStringSBset (const SeparStringSB &s)
 
template<class T >
SeparStringSBset (T t)
 
void setEmpty ()
 
void setSepChar (char)
 
int size () const
 
const char * str () const
 Output escaped. More...
 
const char * unescapedStr () const
 

Private Member Functions

const char * findSeparator (const char *) const
 
const char * getEscaped (const char *unescapedstr, char sep) const
 
const char * getUnescaped (const char *escapedstartptr, const char *nextsep=nullptr) const
 
void initRep (const char *)
 
void initSep (char s)
 

Private Attributes

StringBuilder rep_
 
BufferString retstr_
 
char sep_ [2]
 

Detailed Description

List encoded in a string.

SeparString is a list encoded in a string where the items are separated by a user chosen separator. The separator in the input is escaped with a backslash. A ‘&rsquo; is encoded as ‘\’ . Elements can have any size. Input and output of elements is done unescaped. Input and output of whole (sub)strings is done escaped.

The new class SeparStringSB is based on the new StringBuilder, and will perform much better that the legacy SeparString class.

<>

Constructor & Destructor Documentation

◆ SeparStringSB() [1/2]

SeparStringSB::SeparStringSB ( const char *  escapedstr = nullptr,
char  separ = ',' 
)
inline

◆ SeparStringSB() [2/2]

SeparStringSB::SeparStringSB ( const SeparStringSB ss)
inline

Member Function Documentation

◆ add() [1/6]

SeparStringSB& SeparStringSB::add ( const BufferStringSet )

Concatenation.

◆ add() [2/6]

SeparStringSB& SeparStringSB::add ( const char *  unescapedstr)

◆ add() [3/6]

SeparStringSB& SeparStringSB::add ( const DBKey ,
bool  withsurvloc = true 
)

◆ add() [4/6]

SeparStringSB& SeparStringSB::add ( const OD::String ods)
inline

◆ add() [5/6]

SeparStringSB& SeparStringSB::add ( const SeparStringSB )

Concatenation.

◆ add() [6/6]

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

◆ buf()

const char* SeparStringSB::buf ( ) const
inline

Output escaped.

◆ findSeparator()

const char* SeparStringSB::findSeparator ( const char *  ) const
private

◆ from()

FixedString SeparStringSB::from ( int  ) const

Output escaped.

◆ getCStr()

char* SeparStringSB::getCStr ( )
inline

Output escaped.

◆ getDValue()

double SeparStringSB::getDValue ( int  ) const

◆ getEscaped()

const char* SeparStringSB::getEscaped ( const char *  unescapedstr,
char  sep 
) const
private

◆ getFValue()

float SeparStringSB::getFValue ( int  ) const

◆ getI16Value()

short SeparStringSB::getI16Value ( int  ) const

◆ getI64Value()

int64_t SeparStringSB::getI64Value ( int  ) const

◆ getIValue()

int SeparStringSB::getIValue ( int  ) const

◆ getUI16Value()

unsigned short SeparStringSB::getUI16Value ( int  ) const

◆ getUI64Value()

uint64_t SeparStringSB::getUI64Value ( int  ) const

◆ getUIValue()

unsigned int SeparStringSB::getUIValue ( int  ) const

◆ getUnescaped()

const char* SeparStringSB::getUnescaped ( const char *  escapedstartptr,
const char *  nextsep = nullptr 
) const
private

◆ getYN()

bool SeparStringSB::getYN ( int  ) const

◆ indexOf()

int SeparStringSB::indexOf ( const char *  unescapedstr) const

◆ initRep()

void SeparStringSB::initRep ( const char *  )
private

◆ initSep()

void SeparStringSB::initSep ( char  s)
inlineprivate

◆ isEmpty()

bool SeparStringSB::isEmpty ( ) const
inline

◆ operator const char *()

SeparStringSB::operator const char * ( ) const
inline

◆ operator+=() [1/2]

template<class T >
SeparStringSB& SeparStringSB::operator+= ( const OD::String ods)
inline

◆ operator+=() [2/2]

template<class T >
SeparStringSB& SeparStringSB::operator+= ( t)
inline

◆ operator=() [1/2]

SeparStringSB& SeparStringSB::operator= ( const char *  escapedstr)

◆ operator=() [2/2]

SeparStringSB& SeparStringSB::operator= ( const SeparStringSB )

◆ operator[]()

FixedString SeparStringSB::operator[] ( int  ) const

Output unescaped.

◆ rep()

StringBuilder& SeparStringSB::rep ( )
inline

Output escaped.

◆ sepChar()

char SeparStringSB::sepChar ( ) const
inline

◆ sepStr()

const char* SeparStringSB::sepStr ( ) const
inline

◆ set() [1/5]

SeparStringSB& SeparStringSB::set ( const BufferStringSet bss)
inline

◆ set() [2/5]

SeparStringSB& SeparStringSB::set ( const char *  unescapedstr)
inline

◆ set() [3/5]

SeparStringSB& SeparStringSB::set ( const OD::String ods)
inline

◆ set() [4/5]

SeparStringSB& SeparStringSB::set ( const SeparStringSB s)
inline

◆ set() [5/5]

template<class T >
SeparStringSB& SeparStringSB::set ( t)
inline

◆ setEmpty()

void SeparStringSB::setEmpty ( )
inline

◆ setSepChar()

void SeparStringSB::setSepChar ( char  )

◆ size()

int SeparStringSB::size ( ) const

◆ str()

const char* SeparStringSB::str ( ) const
inline

Output escaped.

◆ unescapedStr()

const char* SeparStringSB::unescapedStr ( ) const
inline

Use with care! Distinction between separ-chars and escaped separ-chars will get lost.

Member Data Documentation

◆ rep_

StringBuilder SeparStringSB::rep_
private

◆ retstr_

BufferString SeparStringSB::retstr_
mutableprivate

◆ sep_

char SeparStringSB::sep_[2]
private

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