OpendTect  6.6
odjson.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 ________________________________________________________________________
4 
5  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
6  Author: Bert
7  Date: April 2018
8 ________________________________________________________________________
9 
10 */
11 
12 #include "filepath.h"
13 #include "od_iosfwd.h"
14 #include "typeset.h"
15 #include "uistringset.h"
16 
17 class DBKeySet;
18 class DBKey;
19 class MultiID;
20 class SeparString;
21 class StringBuilder;
22 namespace Gason { struct JsonNode; }
23 
24 
25 namespace OD
26 {
27 
28 namespace JSON
29 {
30 
31 class Array;
32 class KeyedValue;
33 class Object;
34 class Value;
35 
39 {
41 };
42 
43 typedef double NumberType;
44 
45 
49 {
50 public:
51 
54  typedef BoolTypeSet BSet;
57 
59  ValArr(const ValArr&);
60  ~ValArr() { delete set_; }
61  DataType dataType() const { return type_; }
62 
63  size_type size() const
64  { return (size_type)set_->nrItems(); }
65  bool validIdx( idx_type idx ) const
66  { return set_->validIdx(idx); }
67  bool isEmpty() const { return set_->isEmpty(); }
68  void setEmpty() { set_->setEmpty(); }
69 
70  OD::Set& odSet() { return *set_; }
71  const OD::Set& odSet() const { return *set_; }
72  BSet& bools() { return *((BSet*)set_); }
73  const BSet& bools() const { return *((BSet*)set_); }
74  NSet& vals() { return *((NSet*)set_); }
75  const NSet& vals() const { return *((NSet*)set_); }
76  SSet& strings() { return *((SSet*)set_); }
77  const SSet& strings() const { return *((SSet*)set_); }
78 
79  void dumpJSon(BufferString&) const;
80  void dumpJSon(StringBuilder&) const;
82 
83 protected:
84 
85  DataType type_ = Boolean;
86  OD::Set* set_ = nullptr;
87 
88 };
89 
90 
96 public:
97 
100  enum ValueType { Data, SubArray, SubObject };
102 
103  virtual ValueSet* clone() const = 0;
104  virtual ~ValueSet() { setEmpty(); }
105  virtual bool isArray() const = 0;
106  inline Array& asArray();
107  inline const Array& asArray() const;
108  inline Object& asObject();
109  inline const Object& asObject() const;
110 
111  virtual size_type size() const
112  { return (size_type)values_.size(); }
113  virtual bool isEmpty() const
114  { return values_.isEmpty(); }
115  virtual void setEmpty();
116 
117  virtual ValueType valueType(idx_type) const;
118  inline bool isPlainData( idx_type i ) const
119  { return valueType(i) == Data; }
120  inline bool isArrayChild( idx_type i ) const
121  { return valueType(i) == SubArray; }
122  inline bool isObjectChild( idx_type i ) const
123  { return valueType(i) == SubObject; }
124 
125  bool isTop() const { return !parent_; }
127  const ValueSet* top() const;
128 
129 # define mMkGetFns(typ,getfn,implfn) \
130  inline typ& getfn( idx_type i ) { return *implfn(i); } \
131  inline const typ& getfn( idx_type i ) const { return *implfn(i); }
132  mMkGetFns(ValueSet, child, gtChildByIdx )
133  mMkGetFns(Array, array, gtArrayByIdx )
134  mMkGetFns(Object, object, gtObjectByIdx )
135 # undef mMkSubFn
136 
137  bool getBoolValue(idx_type) const;
139  double getDoubleValue(idx_type) const;
142 
143  uiRetVal parseJSon(char* buf,int bufsz);
144  static ValueSet* getFromJSon(char* buf,int bufsz,uiRetVal&);
145  void dumpJSon(BufferString&) const;
146  void dumpJSon(StringBuilder&) const;
148 
152 
153 protected:
154 
156  : parent_(p) {}
158 
161 
162  void setParent( ValueSet* p ) { parent_ = p; }
163 
167 
168  static ValueSet* gtByParse(char*,int,uiRetVal&,ValueSet*);
169  void use(const GasonNode&);
170 
171  friend class Array;
172  friend class Object;
173  friend class Value;
174  static const char* gtvalnotplaindatastr()
175  { return "ValueSet at idx is not plain data"; }
176 };
177 
178 
186 mExpClass(Basic) Array : public ValueSet
187 {
188 public:
189 
190  Array(bool objects,ValueSet* p=0);
192  Array(const Array&);
194  virtual Array* clone() const { return new Array(*this); }
195  virtual bool isArray() const { return true; }
196  virtual void setEmpty();
197 
198  virtual ValueType valueType(idx_type) const { return valtype_; }
199  ValueType valType() const { return valtype_; }
200  virtual size_type size() const;
201 
202  // Only available if valType() == Data
203  inline ValArr& valArr() { return *valarr_; }
204  inline const ValArr& valArr() const { return *valarr_; }
205 
208 
209  // only usable if valType() == Data
210  Array& add(bool);
216  Array& add(float);
217  Array& add(double);
218  Array& add(const char*);
219  Array& add( const OD::String& odstr )
220  { return add( odstr.str() ); }
221  Array& add(const uiString&);
222  Array& add(const FilePath&);
223  Array& add(const MultiID&);
224  Array& add(const DBKey&);
225 
226  Array& set(bool);
227  Array& set(const od_int16);
228  Array& set(const od_uint16);
229  Array& set(const od_int32);
230  Array& set(const od_uint32);
231  Array& set(const od_int64);
232  Array& set(const float);
233  Array& set(const double);
234  void set(const uiStringSet&);
235  void set(const DBKeySet&);
236  Array& set(const char*);
237  Array& set(const OD::String&);
238  Array& set(const uiString&);
239  Array& set(const FilePath&);
240 
241  Array& set(const MultiID&);
242  Array& set(const DBKey&);
243 
244  void set(const BufferStringSet&);
245  void set(const BoolTypeSet&);
246  void set(const TypeSet<od_int16>&);
247  void set(const TypeSet<od_uint16>&);
248  void set(const TypeSet<od_int32>&);
249  void set(const TypeSet<od_uint32>&);
250  void set(const TypeSet<od_int64>&);
251  void set(const TypeSet<float>&);
252  void set(const TypeSet<double>&);
253  Array& set(const bool*,size_type);
259  Array& set(const float*,size_type);
260  Array& set(const double*,size_type);
261 
262 
263 protected:
264 
267 
268  template <class T>
269  void setVals(const TypeSet<T>&);
270  template <class T>
271  Array& setVals(const T*,size_type);
272  void addVS(ValueSet*);
273 
274  friend class ValueSet;
275  static const char* addarrnonvalstr()
276  { return "add value to non-value Array"; }
277 };
278 
279 
282 mExpClass(Basic) Object : public ValueSet
283 {
284 public:
285 
286  Object( ValueSet* p=0 )
287  : ValueSet(p) {}
288  Object(const Object&);
289  virtual Object* clone() const { return new Object(*this); }
290  virtual bool isArray() const { return false; }
291 
292  idx_type indexOf(const char*) const;
293  bool isPresent( const char* ky ) const
294  { return indexOf(ky) >= 0; }
295 
296 # define mMkGetFn(typ,getfn,implfn) \
297  inline typ* getfn( const char* ky ) { return implfn(ky); } \
298  inline const typ* getfn( const char* ky ) const { return implfn(ky); }
299  mMkGetFn(ValueSet, getChild, gtChildByKey )
300  mMkGetFn(Array, getArray, gtArrayByKey )
301  mMkGetFn(Object, getObject, gtObjectByKey )
302 # undef mMkGetFn
304  inline ValueSet* getChild( const BufferStringSet& bskey )
305  { return gtChildByKeys( bskey ); }
306  inline const ValueSet* getChild( const BufferStringSet& bskey ) const
307  { return gtChildByKeys( bskey ); }
308  inline Array* getArray( const BufferStringSet& bskey )
309  { return gtArrayByKeys( bskey ); }
310  inline const Array* getArray( const BufferStringSet& bskey ) const
311  { return gtArrayByKeys( bskey ); }
312  inline Object* getObject( const BufferStringSet& bskey )
313  { return gtObjectByKeys( bskey ); }
314  inline const Object* getObject( const BufferStringSet& bskey ) const
315  { return gtObjectByKeys( bskey ); }
316 
317  bool getBoolValue(const char*) const;
318  od_int64 getIntValue(const char*) const;
319  double getDoubleValue(const char*) const;
320  BufferString getStringValue(const char*) const;
321  FilePath getFilePath(const char*) const;
322  bool getStrings(const char*,BufferStringSet&) const;
323  bool getGeomID(const char*,Pos::GeomID&) const;
324  template <class T>
325  bool get(const char*,Interval<T>&) const;
326 
327  Array* set(const char* ky,Array*);
328  Object* set(const char* ky,Object*);
329 
330  void set(const char* ky,bool);
331  void set(const char* ky,od_int16);
332  void set(const char* ky,od_uint16);
333  void set(const char* ky,od_int32);
334  void set(const char* ky,od_uint32);
335  void set(const char* ky,od_int64);
336  void set(const char* ky,float);
337  void set(const char* ky,double);
338  void set(const char* ky,const char*);
339  void set( const char* ky, const OD::String& str )
340  { set( ky, str.str() ); }
341  void set(const char* ky,const FilePath&);
342  void set(const char* ky,const DBKey&);
343  void set(const char* ky,const MultiID&);
344  void set(const char* ky,const uiString&);
345  template <class T>
346  void set(const char* ky,const Interval<T>&);
347 
348  void remove(const char*);
349 
350 protected:
351 
352  ValueSet* gtChildByKey(const char*) const;
353  Array* gtArrayByKey(const char*) const;
354  Object* gtObjectByKey(const char*) const;
358 
359  void set(KeyedValue*);
360  void setVS(const char*,ValueSet*);
361  template <class T>
362  void setVal(const char*,T);
363 
364  friend class ValueSet;
365 
366  static const char* errnoemptykey()
367  { return "Empty key not allowed for Object's"; }
368 };
369 
370 
372 { return *static_cast<Array*>( this ); }
373 inline const Array& ValueSet::asArray() const
374 { return *static_cast<const Array*>( this ); }
376 { return *static_cast<Object*>( this ); }
377 inline const Object& ValueSet::asObject() const
378 { return *static_cast<const Object*>( this ); }
379 
380 template <class T>
381 inline bool OD::JSON::Object::get( const char* key, Interval<T>& intrvl ) const
382 {
383  const Array* arr = getArray( key );
384  if ( !arr )
385  return false;
386  const TypeSet<NumberType> intrvals = arr->valArr().vals();
387 
388  intrvl.start = intrvals[0];
389  intrvl.stop = intrvals[1];
390 
391  if ( intrvl.hasStep() )
392  {
393  mDynamicCastGet(StepInterval<T>*,si,&intrvl)
394  si->step = intrvals[2];
395  }
396  return true;
397 }
398 
399 
400 template <class T>
401 inline void OD::JSON::Object::set( const char* key, const Interval<T>& intrvl )
402 {
403  Array* arr = new Array(DataType::Number);
404  TypeSet<NumberType> intrvals;
405  intrvals.add( intrvl.start ).add( intrvl.stop );
406 
407  if ( intrvl.hasStep() )
408  {
409  mDynamicCastGet(const StepInterval<T>*,si,&intrvl)
410  intrvals.add( si->step );
411  }
412 
413  arr->set( intrvals );
414  set( key, arr );
415 }
416 
417 } // namespace JSON
418 
419 } // namespace OD
OD::JSON::ValueSet::isArrayChild
bool isArrayChild(idx_type i) const
Definition: odjson.h:120
OD::JSON::ValueSet::ValueSet
ValueSet(ValueSet *p)
Definition: odjson.h:155
OD::JSON::ValArr::dumpJSon
void dumpJSon(StringBuilder &) const
OD::JSON::Array::set
Array & set(const unsigned int)
StringBuilder
Builds a string by adding strings. Much faster than string manipulation. Only supports adding.
Definition: stringbuilder.h:20
OD::JSON::Array::valueType
virtual ValueType valueType(idx_type) const
Definition: odjson.h:198
OD::JSON::Array::set
Array & set(const short)
Gason::JsonNode
Definition: gason.h:91
OD::JSON::ValueSet::values_
ObjectSet< Value > values_
Definition: odjson.h:160
OD::JSON::Boolean
@ Boolean
Definition: odjson.h:40
sKey::Value
FixedString Value()
Definition: keystrs.h:180
OD::JSON::ValueSet::getFromJSon
static ValueSet * getFromJSon(char *buf, int bufsz, uiRetVal &)
OD::JSON::ValueSet::getStringValue
BufferString getStringValue(idx_type) const
mMkGetFn
#define mMkGetFn(typ, getfn, implfn)
Definition: odjson.h:296
OD::JSON::Array::valArr
ValArr & valArr()
Definition: odjson.h:203
OD::JSON::ValueSet::gtvalnotplaindatastr
static const char * gtvalnotplaindatastr()
Definition: odjson.h:174
OD::JSON::ValueSet::getDoubleValue
double getDoubleValue(idx_type) const
uistringset.h
OD::JSON::ValArr::bools
const BSet & bools() const
Definition: odjson.h:73
OD::JSON::Array::set
Array & set(const unsigned int *, size_type)
OD::JSON::Array::valtype_
ValueType valtype_
Definition: odjson.h:265
OD::JSON::Object::set
void set(const char *ky, int)
OD::JSON::ValueSet::valueType
virtual ValueType valueType(idx_type) const
OD::JSON::Object::get
bool get(const char *, Interval< T > &) const
Definition: odjson.h:381
OD::JSON::Object::set
void set(KeyedValue *)
OD::JSON::Array::add
Array & add(short)
OD::JSON::Object::gtChildByKeys
ValueSet * gtChildByKeys(const BufferStringSet &) const
uiStringSet
Definition: uistringset.h:23
ObjectSet< Value >
OD::JSON::Array::setVals
Array & setVals(const T *, size_type)
OD::JSON::ValueSet::gtObjectByIdx
Object * gtObjectByIdx(idx_type) const
OD::JSON::Object::set
void set(const char *ky, const uiString &)
OD::JSON::Object::getArray
const Array * getArray(const BufferStringSet &bskey) const
Definition: odjson.h:310
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
OD::JSON::Array::add
Array & add(bool)
OD::JSON::Object::getStrings
bool getStrings(const char *, BufferStringSet &) const
OD::JSON::Array::set
Array & set(const int64_t *, size_type)
OD::JSON::ValueSet::idx_type
size_type idx_type
Definition: odjson.h:99
OD::JSON::Array::valType
ValueType valType() const
Definition: odjson.h:199
OD::JSON::ValueSet::GasonNode
Gason::JsonNode GasonNode
Definition: odjson.h:101
od_int64
#define od_int64
Definition: plftypes.h:35
OD::JSON::Object::set
void set(const char *ky, float)
OD::JSON::ValArr::odSet
OD::Set & odSet()
Definition: odjson.h:70
OD
OpendTect.
Definition: commontypes.h:28
OD::JSON::ValueSet::gtChildByIdx
ValueSet * gtChildByIdx(idx_type) const
OD::JSON::Array::valarr_
ValArr * valarr_
Definition: odjson.h:266
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
OD::JSON::Array::Array
Array(const Array &)
OD::JSON::Object::getGeomID
bool getGeomID(const char *, Pos::GeomID &) const
od_istream
OD class for stream read common access to the std::cin.
Definition: od_istream.h:24
OD::JSON::Object::set
void set(const char *ky, bool)
OD::JSON::Array::add
Array & add(const char *)
FilePath
File pathname tools.
Definition: filepath.h:34
OD::JSON::ValArr::ValArr
ValArr(const ValArr &)
OD::JSON::ValueSet::getBoolValue
bool getBoolValue(idx_type) const
OD::JSON::ValueSet::clone
virtual ValueSet * clone() const =0
OD::JSON::Array::set
Array & set(const short *, size_type)
TypeSet< BoolTypeSetType >::size_type
OD::ValVec< BoolTypeSetType, int >::size_type size_type
Definition: typeset.h:185
OD::JSON::Array::add
Array & add(unsigned short)
OD::JSON::Array::add
Array & add(const MultiID &)
OD::JSON::Array::setVals
void setVals(const TypeSet< T > &)
OD::JSON::Object::getObject
Object * getObject(const BufferStringSet &bskey)
Definition: odjson.h:312
OD::JSON::Object::set
void set(const char *ky, const DBKey &)
OD::JSON::Array::set
void set(const BufferStringSet &)
OD::JSON::ValArr::dumpJSon
BufferString dumpJSon() const
mDynamicCastGet
#define mDynamicCastGet(typ, out, in)
Definition: commondefs.h:148
OD::JSON::ValArr::strings
SSet & strings()
Definition: odjson.h:76
typeset.h
uiRetVal
Definition: uistringset.h:105
OD::JSON::Array::set
Array & set(const float *, size_type)
OD::JSON::ValueSet::ValueSet
ValueSet(const ValueSet &)
OD::JSON::Object::Object
Object(ValueSet *p=0)
Definition: odjson.h:286
OD::JSON::ValArr::SSet
BufferStringSet SSet
Definition: odjson.h:56
OD::JSON::Array::set
Array & set(const FilePath &)
OD::JSON::Object::set
void set(const char *ky, unsigned short)
Repos::Data
@ Data
Definition: repos.h:24
OD::JSON::Array::addVS
void addVS(ValueSet *)
OD::JSON::Array::set
Array & set(const OD::String &)
OD::JSON::Array::add
Array & add(const FilePath &)
OD::JSON::Object::set
void set(const char *ky, short)
OD::JSON::Array::add
Array & add(float)
OD::JSON::Array::set
Array & set(const int64_t)
OD::JSON::Array::set
Array & set(const bool *, size_type)
OD::JSON::Array::isArray
virtual bool isArray() const
Definition: odjson.h:195
OD::JSON::Array::set
Array & set(const char *)
OD::JSON::ValueSet::isPlainData
bool isPlainData(idx_type i) const
Definition: odjson.h:118
OD::JSON::ValArr::setEmpty
void setEmpty()
Definition: odjson.h:68
mODTextTranslationClass
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
OD::JSON::ValArr::BSet
BoolTypeSet BSet
Definition: odjson.h:54
OD::JSON::Object::set
void set(const char *ky, const FilePath &)
OD::JSON::ValueSet::write
uiRetVal write(od_ostream &)
OD::JSON::Array::setEmpty
virtual void setEmpty()
OD::JSON::ValArr::dumpJSon
void dumpJSon(BufferString &) const
OD::JSON::Object::indexOf
idx_type indexOf(const char *) const
OD::JSON::ValArr::idx_type
size_type idx_type
Definition: odjson.h:53
OD::JSON::Array::add
Array & add(const uiString &)
OD::JSON::Array::set
Array & set(const float)
OD::JSON::ValueSet::setEmpty
virtual void setEmpty()
OD::JSON::ValArr::validIdx
bool validIdx(idx_type idx) const
Definition: odjson.h:65
OD::JSON::Object::gtObjectByKeys
Object * gtObjectByKeys(const BufferStringSet &) const
OD::JSON::Array::set
void set(const TypeSet< short > &)
OD::JSON::Array::set
Array & set(const int *, size_type)
StepInterval
Interval with step.
Definition: commontypes.h:32
OD::JSON::Object::set
void set(const char *ky, int64_t)
OD::JSON::Array::set
void set(const TypeSet< float > &)
OD::JSON::ValueSet::gtByParse
static ValueSet * gtByParse(char *, int, uiRetVal &, ValueSet *)
OD::JSON::Object::set
void set(const char *ky, const char *)
OD::JSON::Object::getSubObjKeys
void getSubObjKeys(BufferStringSet &) const
OD::JSON::Object::gtArrayByKeys
Array * gtArrayByKeys(const BufferStringSet &) const
OD::JSON::Array::add
Array & add(unsigned int)
OD::JSON::Array::clone
virtual Array * clone() const
Definition: odjson.h:194
OD::JSON::Number
@ Number
Definition: odjson.h:40
OD::JSON::Array::add
Array * add(Array *)
OD::JSON::Object::setVS
void setVS(const char *, ValueSet *)
OD::JSON::Array::set
Array & set(const DBKey &)
OD::String::str
const char * str() const
Definition: odstring.h:47
OD::JSON::ValueSet::gtArrayByIdx
Array * gtArrayByIdx(idx_type) const
OD::JSON::ValArr::isEmpty
bool isEmpty() const
Definition: odjson.h:67
OD::JSON::Object::Object
Object(const Object &)
OD::JSON::Object::set
Array * set(const char *ky, Array *)
indexOf
BufferStringSet::idx_type indexOf(const BufferStringSet &, const char *)
OD::JSON::ValueSet::getIntValue
int64_t getIntValue(idx_type) const
OD::JSON::ValueSet::getFilePath
FilePath getFilePath(idx_type) const
OD::JSON::Array::set
void set(const DBKeySet &)
OD::JSON::Array::set
void set(const TypeSet< double > &)
OD::JSON::Array::~Array
~Array()
sKey::Object
FixedString Object()
Definition: keystrs.h:112
OD::JSON::Array::set
void set(const TypeSet< unsigned int > &)
OD::JSON::ValueSet::dumpJSon
void dumpJSon(BufferString &) const
OD::JSON::Array::set
void set(const BoolTypeSet &)
OD::JSON::ValueSet::isTop
bool isTop() const
Definition: odjson.h:125
OD::JSON::Object::set
void set(const char *ky, unsigned int)
OD::JSON::ValueSet::setParent
void setParent(ValueSet *p)
Definition: odjson.h:162
DBKey
Definition: dbkey.h:21
OD::JSON::ValArr::odSet
const OD::Set & odSet() const
Definition: odjson.h:71
OD::JSON::ValArr
Definition: odjson.h:49
OD::JSON::Array::set
Array & set(bool)
OD::JSON::Object::getChild
const ValueSet * getChild(const BufferStringSet &bskey) const
Definition: odjson.h:306
od_int16
#define od_int16
Definition: plftypes.h:26
OD::JSON::Object::getArray
Array * getArray(const BufferStringSet &bskey)
Definition: odjson.h:308
OD::JSON::Object::isArray
virtual bool isArray() const
Definition: odjson.h:290
OD::JSON::ValueSet::isEmpty
virtual bool isEmpty() const
Definition: odjson.h:113
OD::JSON::Array::Array
Array(bool objects, ValueSet *p=0)
OD::JSON::Array::set
Array & set(const double)
SeparString
Definition: separstr.h:136
OD::JSON::ValueSet::size
virtual size_type size() const
Definition: odjson.h:111
OD::JSON::ValArr::strings
const SSet & strings() const
Definition: odjson.h:77
Gason
Definition: odjson.h:22
OD::JSON::Object::setVal
void setVal(const char *, T)
OD::JSON::Array
ValueSet where the values and subsets have no key.
Definition: odjson.h:187
OD::JSON::Object::set
void set(const char *ky, const OD::String &str)
Definition: odjson.h:339
OD::JSON::ValArr::size
size_type size() const
Definition: odjson.h:63
OD::JSON::Object::clone
virtual Object * clone() const
Definition: odjson.h:289
OD::JSON::ValArr::vals
NSet & vals()
Definition: odjson.h:74
OD::JSON::Object::isPresent
bool isPresent(const char *ky) const
Definition: odjson.h:293
OD::JSON::Array::valArr
const ValArr & valArr() const
Definition: odjson.h:204
OD::JSON::Array::set
Array & set(const unsigned short *, size_type)
OD::JSON::Object::getBoolValue
bool getBoolValue(const char *) const
od_uint16
#define od_uint16
Definition: plftypes.h:27
OD::JSON::Array::set
Array & set(const unsigned short)
Conv::set
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:27
OD::JSON::Object::gtArrayByKey
Array * gtArrayByKey(const char *) const
OD::JSON::Object::getObject
const Object * getObject(const BufferStringSet &bskey) const
Definition: odjson.h:314
OD::JSON::Object::getChild
ValueSet * getChild(const BufferStringSet &bskey)
Definition: odjson.h:304
OD::JSON::ValueSet::top
ValueSet * top()
OD::JSON::ValueSet::~ValueSet
virtual ~ValueSet()
Definition: odjson.h:104
MultiID
Compound key consisting of ints.
Definition: multiid.h:24
OD::JSON::Object::getStringValue
BufferString getStringValue(const char *) const
OD::JSON::Array::set
Array & set(const uiString &)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Interval::hasStep
virtual bool hasStep() const
Definition: ranges.h:125
OD::JSON::ValArr::vals
const NSet & vals() const
Definition: odjson.h:75
OD::JSON::ValueSet::asObject
Object & asObject()
Definition: odjson.h:375
OD::JSON::Array::addarrnonvalstr
static const char * addarrnonvalstr()
Definition: odjson.h:275
OD::JSON::Array::set
void set(const TypeSet< int > &)
OD::JSON::ValueSet::dumpJSon
void dumpJSon(StringBuilder &) const
OD::JSON::ValueSet::top
const ValueSet * top() const
OD::JSON::ValueSet::size_type
ValArr::size_type size_type
Definition: odjson.h:98
OD::JSON::ValueSet::asArray
Array & asArray()
Definition: odjson.h:371
OD::JSON::Array::set
void set(const uiStringSet &)
OD::JSON::Object::errnoemptykey
static const char * errnoemptykey()
Definition: odjson.h:366
OD::JSON::Array::add
Array & add(int64_t)
OD::JSON::ValueSet::isObjectChild
bool isObjectChild(idx_type i) const
Definition: odjson.h:122
OD::JSON::Object::set
void set(const char *ky, double)
OD::JSON::ValArr::size_type
BoolTypeSet::size_type size_type
Definition: odjson.h:52
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
od_int32
#define od_int32
Definition: plftypes.h:30
OD::JSON::Array::add
Array & add(const DBKey &)
OD::String
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
od_iosfwd.h
DBKeySet
Definition: dbkey.h:58
OD::JSON::Array::set
void set(const TypeSet< unsigned short > &)
OD::JSON::Object::getIntValue
int64_t getIntValue(const char *) const
OD::JSON::ValArr::ValArr
ValArr(DataType)
OD::JSON::Array::set
Array & set(const int)
OD::JSON::ValArr::dataType
DataType dataType() const
Definition: odjson.h:61
OD::JSON::Array::Array
Array(DataType, ValueSet *p=0)
OD::JSON::ValueSet::parseJSon
uiRetVal parseJSon(char *buf, int bufsz)
OD::JSON::ValueSet::parent_
ValueSet * parent_
Definition: odjson.h:159
OD::JSON::ValueSet::use
void use(const GasonNode &)
OD::JSON::Object::remove
void remove(const char *)
OD::JSON::Object::gtObjectByKey
Object * gtObjectByKey(const char *) const
OD::JSON::Object::set
void set(const char *ky, const MultiID &)
OD::JSON::Array::add
Array & add(int)
OD::JSON::NumberType
double NumberType
Definition: odjson.h:43
OD::JSON::ValueSet::ValueType
ValueType
Definition: odjson.h:100
mMkGetFns
#define mMkGetFns(typ, getfn, implfn)
Definition: odjson.h:129
OD::JSON::ValueSet
holds values and sets of values. Is base class for either Array or Object.
Definition: odjson.h:95
DataType
Data type.
Definition: datainpspec.h:31
od_uint32
#define od_uint32
Definition: plftypes.h:31
OD::JSON::Array::set
void set(const TypeSet< int64_t > &)
Interval
Interval of values.
Definition: commontypes.h:30
OD::JSON::Object::gtChildByKey
ValueSet * gtChildByKey(const char *) const
od_ostream
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
OD::JSON::ValueSet::read
static ValueSet * read(od_istream &, uiRetVal &)
OD::JSON::Array::add
Object * add(Object *)
OD::JSON::Object::getDoubleValue
double getDoubleValue(const char *) const
OD::JSON::Array::set
Array & set(const double *, size_type)
OD::JSON::Array::add
Array & add(const OD::String &odstr)
Definition: odjson.h:219
OD::JSON::ValArr::bools
BSet & bools()
Definition: odjson.h:72
Pos::GeomID
Index_Type GeomID
Definition: commontypes.h:87
OD::JSON::ValueSet::read
uiRetVal read(od_istream &)
OD::JSON::ValueSet::isArray
virtual bool isArray() const =0
filepath.h
OD::JSON::Object
ValueSet where the values and subsets have a key.
Definition: odjson.h:283
TypeSet< BoolTypeSetType >
OD::JSON::Array::set
Array & set(const MultiID &)
OD::JSON::ValArr::NSet
TypeSet< NumberType > NSet
Definition: odjson.h:55
OD::Set
Base class for all sets used in OpendTect.
Definition: odset.h:33
OD::JSON::Object::set
Object * set(const char *ky, Object *)
OD::JSON::ValueSet::dumpJSon
BufferString dumpJSon() const
OD::JSON::Array::add
Array & add(double)
OD::JSON::ValArr::~ValArr
~ValArr()
Definition: odjson.h:60
OD::JSON::Object::getFilePath
FilePath getFilePath(const char *) const
OD::JSON::Array::size
virtual size_type size() const

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