50 inline BufferString(
const char*,
const T&,
const char* s=0);
54 {
return assignTo(b.
buf_); }
56 {
return assignTo(s); }
58 {
return assignTo(s.
str()); }
60 {
return assignTo(s.
str()); }
64 inline operator const char*()
const {
return buf(); }
76 {
return const_cast<char*
>(
const_cast<BufferString*
>(
this)->gtBuf()); }
77 void fill(
char*,
int maxnrchar)
const;
80 inline char& operator [](
int idx ) {
return getCStr()[idx]; }
82 char*
find(
const char*);
83 inline const char*
find(
char)
const;
84 inline const char*
find(
const char*)
const;
86 char* findLast(
const char*);
87 inline const char* findLast(
char)
const;
88 inline const char* findLast(
const char*)
const;
115 inline unsigned int bufSize()
const {
return len_; }
116 bool setBufSize(
unsigned int);
118 void setMinBufSize(
unsigned int);
128 BufferString& replaceAt(
int idx,
const char*,
bool cutoff=
true);
138 NoSpaces, NoFileSeps, NoSpecialChars };
151 const char* gtBuf()
const;
152 inline const char* gtStr()
const;
157 inline void destroy() {
delete [] buf_; buf_ = 0; }
165 {
return add(s.
str()); }
186 #define mBufferStringSimpConstrInitList \ 187 minlen_(mMaxFilePathLength+1), buf_(0), len_(0) 196 template <
class T>
inline 199 { *
this += s1; *
this += t; *
this += s2; }
202 {
return buf_ && *
buf_ ?
const_cast<char*
>(
buf_ ) : 0; }
const char * find(char) const
bool operator==(const BufferString &) const
Definition: bufstring.h:204
#define mExpClass(module)
Definition: commondefs.h:160
BufferString & quote(char q='\'')
Definition: bufstring.h:134
CleanType
Definition: bufstring.h:137
const char * str() const
Definition: odstring.h:48
BufferString & operator=(const FixedString &s)
Definition: bufstring.h:57
T to(const F &fr)
Definition: convert.h:33
BufferString & operator=(const BufferString &b)
Definition: bufstring.h:53
void OD_Undef_const_char_eq_bs_finder()
OD::String that holds an existing text string.
Definition: fixedstring.h:29
BufferString & operator+=(const T &t)
Definition: bufstring.h:167
const char * gtStr() const
Definition: bufstring.h:201
BufferString & setEmpty()
Definition: bufstring.h:137
BufferString & operator=(const OD::String &s)
Definition: bufstring.h:59
bool operator!=(const char *, const BufferString &)
Definition: bufstring.h:180
BufferString & add(const OD::String &s)
Definition: bufstring.h:102
BufferString & operator+=(const char *s)
Definition: bufstring.h:163
BufferString & addLim(float, int maxnrchars)
unsigned int len_
Definition: bufstring.h:146
bool operator==(const char *, const BufferString &)
Definition: bufstring.h:178
bool isEqual(const char *, CaseSensitivity c=CaseSensitive) const
unsigned int bufSize() const
Definition: bufstring.h:115
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
BufferString & assignTo(const char *)
unsigned int minBufSize() const
Definition: bufstring.h:117
bool operator!=(const BufferString &) const
Definition: bufstring.h:206
char * buf_
Definition: bufstring.h:145
BufferString & set(const char *)
Definition: bufstring.h:236
BufferString & unQuote(char q='\'')
Definition: bufstring.h:135
const T * find(const ObjectSet< T > &os, const S &val)
Get const object in set.
Definition: objectset.h:183
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
const char * findLast(char) const
BufferString & setLim(float, int maxnrchars)
Definition: bufstring.h:248
OpendTect.
Definition: commontypes.h:29
BufferString & operator=(const char *s)
Definition: bufstring.h:55
BufferString()
Definition: bufstring.h:189
BufferString & operator+=(const OD::String &s)
Definition: bufstring.h:164
#define mBufferStringSimpConstrInitList
Definition: bufstring.h:186
void OD_Undef_const_char_neq_bs_finder()
char * getCStr()
Definition: bufstring.h:75
Export_Basic const char * toString(ViewStyle)
const unsigned int minlen_
Definition: bufstring.h:147
void destroy()
Definition: bufstring.h:157