OpendTect  7.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SeparString Class Reference

List encoded in a string. More...

Inheritance diagram for SeparString:
[legend]

Public Member Functions

 SeparString (const char *escapedstr=nullptr, char separ=',')
 
 SeparString (const SeparString &ss)
 
SeparStringadd (const BufferStringSet &)
 Concatenation. More...
 
SeparStringadd (const char *unescapedstr)
 
SeparStringadd (const DBKey &, bool withsurvloc=true)
 
SeparStringadd (const OD::String &ods)
 
SeparStringadd (const SeparString &)
 Concatenation. More...
 
template<class T >
SeparStringadd (T t)
 
const char * buf () const
 Output escaped. More...
 
StringView first () const
 
StringView from (int) const
 Output escaped. More...
 
char * getCStr ()
 Output escaped. More...
 
double getDValue (int) const
 
float getFValue (int) const
 
std::int16_t getI16Value (int) const
 
std::int64_t getI64Value (int) const
 
std::int32_t getIValue (int) const
 
std::uint16_t getUI16Value (int) const
 
std::uint64_t getUI64Value (int) const
 
std::uint32_t getUIValue (int) const
 
bool getYN (int) const
 
int indexOf (const char *unescapedstr) const
 
bool isEmpty () const
 
StringView last () const
 
 operator const char * () const
 
template<class T >
SeparStringoperator+= (const OD::String &ods)
 
template<class T >
SeparStringoperator+= (T t)
 
SeparStringoperator= (const char *escapedstr)
 
SeparStringoperator= (const SeparString &)
 
StringView operator[] (int) const
 Output unescaped. More...
 
StringBuilderrep ()
 Output escaped. More...
 
char sepChar () const
 
const char * sepStr () const
 
SeparStringset (const BufferStringSet &bss)
 
SeparStringset (const char *unescapedstr)
 
SeparStringset (const OD::String &ods)
 
SeparStringset (const SeparString &s)
 
template<class T >
SeparStringset (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.

<>

Constructor & Destructor Documentation

◆ SeparString() [1/2]

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

◆ SeparString() [2/2]

SeparString::SeparString ( const SeparString ss)
inline

Member Function Documentation

◆ add() [1/6]

SeparString& SeparString::add ( const BufferStringSet )

Concatenation.

◆ add() [2/6]

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

◆ add() [3/6]

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

◆ add() [4/6]

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

◆ add() [5/6]

SeparString& SeparString::add ( const SeparString )

Concatenation.

◆ add() [6/6]

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

◆ buf()

const char* SeparString::buf ( ) const
inline

Output escaped.

◆ findSeparator()

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

◆ first()

StringView SeparString::first ( ) const

◆ from()

StringView SeparString::from ( int  ) const

Output escaped.

◆ getCStr()

char* SeparString::getCStr ( )
inline

Output escaped.

◆ getDValue()

double SeparString::getDValue ( int  ) const

◆ getEscaped()

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

◆ getFValue()

float SeparString::getFValue ( int  ) const

◆ getI16Value()

std::int16_t SeparString::getI16Value ( int  ) const

◆ getI64Value()

std::int64_t SeparString::getI64Value ( int  ) const

◆ getIValue()

std::int32_t SeparString::getIValue ( int  ) const

◆ getUI16Value()

std::uint16_t SeparString::getUI16Value ( int  ) const

◆ getUI64Value()

std::uint64_t SeparString::getUI64Value ( int  ) const

◆ getUIValue()

std::uint32_t SeparString::getUIValue ( int  ) const

◆ getUnescaped()

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

◆ getYN()

bool SeparString::getYN ( int  ) const

◆ indexOf()

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

◆ initRep()

void SeparString::initRep ( const char *  )
private

◆ initSep()

void SeparString::initSep ( char  s)
inlineprivate

◆ isEmpty()

bool SeparString::isEmpty ( ) const
inline

◆ last()

StringView SeparString::last ( ) const

◆ operator const char *()

SeparString::operator const char * ( ) const
inline

◆ operator+=() [1/2]

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

◆ operator+=() [2/2]

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

SeparString& SeparString::operator= ( const SeparString )

◆ operator[]()

StringView SeparString::operator[] ( int  ) const

Output unescaped.

◆ rep()

StringBuilder& SeparString::rep ( )
inline

Output escaped.

◆ sepChar()

char SeparString::sepChar ( ) const
inline

◆ sepStr()

const char* SeparString::sepStr ( ) const
inline

◆ set() [1/5]

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

◆ set() [2/5]

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

◆ set() [3/5]

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

◆ set() [4/5]

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

◆ set() [5/5]

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

◆ setEmpty()

void SeparString::setEmpty ( )
inline

◆ setSepChar()

void SeparString::setSepChar ( char  )

◆ size()

int SeparString::size ( ) const

◆ str()

const char* SeparString::str ( ) const
inline

Output escaped.

◆ unescapedStr()

const char* SeparString::unescapedStr ( ) const
inline

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

Member Data Documentation

◆ rep_

StringBuilder SeparString::rep_
private

◆ retstr_

BufferString SeparString::retstr_
mutableprivate

◆ sep_

char SeparString::sep_[2]
private

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