OpendTect 8.0
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SeparString Class Reference

List encoded in a string. More...

#include <separstr.h>

Inheritance diagram for SeparString:
[legend]

Public Member Functions

 SeparString (const char *escapedstr=nullptr, char separ=',')
 
 SeparString (const SeparString &)
 
 ~SeparString ()
 
SeparStringadd (const BufferStringSet &)
 Concatenation.
 
SeparStringadd (const char *unescapedstr)
 
SeparStringadd (const DBKey &, bool withsurvloc=true)
 
SeparStringadd (const OD::String &ods)
 
SeparStringadd (const SeparString &)
 Concatenation.
 
template<>
SeparStringadd (double d)
 
template<>
SeparStringadd (float f)
 
template<class T >
SeparStringadd (T t)
 
const char * buf () const
 Output escaped.
 
StringView first () const
 
StringView from (int) const
 Output escaped.
 
char * getCStr ()
 Output escaped.
 
double getDValue (int) const
 
float getFValue (int) const
 
od_int16 getI16Value (int) const
 
od_int64 getI64Value (int) const
 
od_int32 getIValue (int) const
 
od_uint16 getUI16Value (int) const
 
od_uint64 getUI64Value (int) const
 
od_uint32 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.
 
StringBuilderrep ()
 Output escaped.
 
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.
 
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 = ',' )

◆ SeparString() [2/2]

SeparString::SeparString ( const SeparString & )

◆ ~SeparString()

SeparString::~SeparString ( )

Member Function Documentation

◆ add() [1/8]

SeparString & SeparString::add ( const BufferStringSet & )

Concatenation.

◆ add() [2/8]

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

◆ add() [3/8]

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

◆ add() [4/8]

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

◆ add() [5/8]

SeparString & SeparString::add ( const SeparString & )

Concatenation.

◆ add() [6/8]

template<>
SeparString & SeparString::add ( double d)
inline

◆ add() [7/8]

template<>
SeparString & SeparString::add ( float f)
inline

◆ add() [8/8]

template<class T >
SeparString & SeparString::add ( T 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()

od_int16 SeparString::getI16Value ( int ) const

◆ getI64Value()

od_int64 SeparString::getI64Value ( int ) const

◆ getIValue()

od_int32 SeparString::getIValue ( int ) const

◆ getUI16Value()

od_uint16 SeparString::getUI16Value ( int ) const

◆ getUI64Value()

od_uint64 SeparString::getUI64Value ( int ) const

◆ getUIValue()

od_uint32 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 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 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-2025