30 namespace OD {
class String; }
64 inline
bool toBool( const
char* s,
bool defval=true )
67 inline float toFloat(
const char* s,
float defval=0 )
68 {
float ret = defval;
getFromString( ret, s, ret );
return ret; }
70 inline double toDouble(
const char* s,
double defval=0 )
71 {
double ret = defval;
getFromString( ret, s, ret );
return ret; }
73 inline int toInt(
const char* s,
int defval=0 )
74 {
int ret = defval;
getFromString( ret, s, ret );
return ret; }
81 #define mSkipBlanks(ptr) \ 82 { if ( ptr ) { while ( *(ptr) && iswspace(*(ptr)) ) (ptr)++; } } 85 #define mSkipNonBlanks(ptr) \ 86 { if ( ptr ) { while ( *(ptr) && !iswspace(*(ptr)) ) (ptr)++; } } 89 #define mTrimBlanks(ptr) \ 90 { mSkipBlanks(ptr); removeTrailingBlanks(ptr); } 94 int match_nrchars=-1);
97 const
char* maybebigger);
102 const
char* maybebigger);
153 int startnr=0,
int nr_chars_to_match=0,
158 int startnr=0,
int nr_chars_to_match=0,
165 bool parensonunit,
char* str=0);
int toInt(const char *s, int defval=0)
Definition: string2.h:73
bool getFromString(int &, const char *, int udfval)
float toFloat(const char *s, float defval=0)
Definition: string2.h:67
bool isNumberString(const char *, bool int_only=false)
#define mGlobal(module)
Definition: commondefs.h:163
#define od_int64
Definition: plftypes.h:36
int64_t toInt64(const char *s, int64_t defval=0)
Definition: string2.h:76
const char * getNextWord(const char *, char *)
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:29
const char * getRankPostFix(int)
double toDouble(const char *s, double defval=0)
Definition: string2.h:70
Set of BufferString objects.
Definition: bufstringset.h:28
bool isAlphaNumString(const char *, bool allowspace=false)
bool stringEndsWithCI(const char *, const char *)
bool stringStartsWithCI(const char *, const char *)
bool yesNoFromString(const char *)
bool caseInsensitiveEqual(const char *, const char *, int match_nrchars=-1)
#define od_uint32
Definition: plftypes.h:32
void cleanupString(char *, bool, bool, bool)
const char * getBytesString(uint64_t)
const char * getLimitedDisplayString(const char *, int nrchars, bool trimright)
void removeTrailingBlanks(char *)
char * truncateString(char *str, int maxlen)
const char * getVelUnitString(bool isfeet, bool withparentheses)
#define od_uint64
Definition: plftypes.h:37
const char * getDistUnitString(bool isfeet, bool withparentheses)
const char * getYesNoString(bool)
#define od_int32
Definition: plftypes.h:31
const char * toStringLim(float, int maxtxtwdth)
const char * getAreaString(float m2, bool parensonunit, char *str=0)
Concatenated short keys separated by dots. Used for Object identifiers in the Object Manager...
Definition: compoundkey.h:23
OpendTect.
Definition: commontypes.h:29
const char * lastOcc(const char *, char)
const char * firstOcc(const char *, char)
bool stringEndsWith(const char *endstring, const char *maybebigger)
const char * toStringPrecise(float)
Export_Basic const char * toString(PythonSource)
bool stringStartsWith(const char *startstring, const char *maybebigger)
int getIndexInStringArrCI(const char *, const char *const *arr, int startnr=0, int nr_chars_to_match=0, int notfoundidx=-1)
bool toBool(const char *s, bool defval=true)
Definition: string2.h:64