OpendTect 8.0
Loading...
Searching...
No Matches
OD::JSON::Object Class Reference

ValueSet where the values and subsets have a key. More...

#include <odjson.h>

Inheritance diagram for OD::JSON::Object:
[legend]

Public Member Functions

 Object (const Object &)
 
 Object (ValueSet *p=nullptr)
 
 ~Object ()
 
Object * clone () const override
 
DataType dType (idx_type) const
 Only for ValueType==Data.
 
template<class T>
bool get (const char *, Array1D< T > &) const
 
template<class T>
bool get (const char *, Array2D< T > &) const
 
bool get (const char *, BoolTypeSet &) const
 
bool get (const char *, BufferStringSet &) const
 
bool get (const char *, Coord &) const
 
bool get (const char *, Coord3 &) const
 
bool get (const char *, DBKeySet &) const
 
template<class T>
bool get (const char *, Interval< T > &) const
 
bool get (const char *, TypeSet< MultiID > &) const
 
template<class T>
bool get (const char *, TypeSet< T > &) const
 
bool get (const char *, uiStringSet &) const
 
bool get (const char *,::IdxPair &) const
 
Array * getArray (const BufferStringSet &bskey)
 
const Array * getArray (const BufferStringSet &bskey) const
 
Array * getArray (const char *ky)
 
const Array * getArray (const char *ky) const
 
bool getBoolValue (const char *) const
 
bool getBoolValue (const OD::String &str) const
 
bool getBoolValue (idx_type idx) const override
 
ValueSet * getChild (const BufferStringSet &bskey)
 
const ValueSet * getChild (const BufferStringSet &bskey) const
 
ValueSet * getChild (const char *ky)
 
const ValueSet * getChild (const char *ky) const
 
double getDoubleValue (const char *) const
 
double getDoubleValue (const OD::String &str) const
 
double getDoubleValue (idx_type idx) const override
 
FilePath getFilePath (const char *) const
 
FilePath getFilePath (const OD::String &str) const
 
FilePath getFilePath (idx_type idx) const override
 
bool getGeomID (const char *, Pos::GeomID &) const
 
od_int64 getIntValue (const char *) const
 
od_int64 getIntValue (const OD::String &str) const
 
od_int64 getIntValue (idx_type idx) const override
 
MultiID getMultiID (const char *) const
 
Object * getObject (const BufferStringSet &bskey)
 
const Object * getObject (const BufferStringSet &bskey) const
 
Object * getObject (const char *ky)
 
const Object * getObject (const char *ky) const
 
bool getStrings (const char *, BufferStringSet &) const
 
BufferString getStringValue (const char *) const
 
BufferString getStringValue (const OD::String &str) const
 
BufferString getStringValue (idx_type idx) const override
 
void getSubObjKeys (BufferStringSet &) const
 
idx_type indexOf (const char *) const
 
bool isArray () const override
 
bool isNull (const char *) const
 
bool isPresent (const char *ky) const
 
Object & operator= (const Object &)=delete
 
void remove (const char *)
 
Array * set (const char *ky, Array *)
 
void set (const char *ky, bool)
 
void set (const char *ky, const ::IdxPair &)
 
template<class T>
void set (const char *ky, const Array1D< T > &)
 
template<class T>
void set (const char *ky, const Array2D< T > &)
 
void set (const char *ky, const BoolTypeSet &)
 
void set (const char *ky, const BufferStringSet &)
 
void set (const char *ky, const char *)
 
void set (const char *ky, const Coord &)
 
void set (const char *ky, const Coord3 &)
 
void set (const char *ky, const DBKey &)
 
void set (const char *ky, const DBKeySet &)
 
void set (const char *ky, const FilePath &)
 
template<class T>
void set (const char *ky, const Interval< T > &)
 
void set (const char *ky, const MultiID &)
 
void set (const char *ky, const OD::String &str)
 
void set (const char *ky, const TypeSet< Coord > &)
 
void set (const char *ky, const TypeSet< Coord3 > &)
 
void set (const char *ky, const TypeSet< MultiID > &)
 
template<class T>
void set (const char *ky, const TypeSet< T > &)
 
void set (const char *ky, const uiString &)
 
void set (const char *ky, const uiStringSet &)
 
void set (const char *ky, double)
 
void set (const char *ky, float)
 
Object * set (const char *ky, Object *)
 
void set (const char *ky, od_int16)
 
void set (const char *ky, od_int32)
 
void set (const char *ky, od_int64)
 
void set (const char *ky, od_uint16)
 
void set (const char *ky, od_uint32)
 
void setNull (const char *)
 
bool validIdx (idx_type idx) const
 
- Public Member Functions inherited from OD::JSON::ValueSet
virtual ~ValueSet ()
 
Array & array (idx_type i)
 
const Array & array (idx_type i) const
 
Array & asArray ()
 
const Array & asArray () const
 
Object & asObject ()
 
const Object & asObject () const
 
ValueSet & child (idx_type i)
 
const ValueSet & child (idx_type i) const
 
virtual BufferString dumpJSon (bool pretty=false) const
 
void dumpJSon (BufferString &, bool pretty=false) const
 
virtual void dumpJSon (StringBuilder &) const
 
bool isArrayChild (idx_type i) const
 
virtual bool isEmpty () const
 
bool isNull (idx_type i) const
 
bool isObjectChild (idx_type i) const
 
bool isPlainData (idx_type i) const
 
bool isTop () const
 
const BufferString & key (idx_type) const
 
Object & object (idx_type i)
 
const Object & object (idx_type i) const
 
ValueSet & operator= (const ValueSet &)=delete
 
uiRetVal parseJSon (char *buf, int bufsz)
 
uiRetVal parseJSon (char *buf, int bufsz, bool allowmixedarr)
 
uiRetVal read (const char *fnm)
 
uiRetVal read (const char *fnm, bool allowmixedarr)
 
uiRetVal read (od_istream &)
 
uiRetVal read (od_istream &, bool allowmixedarr)
 
virtual void setEmpty ()
 
virtual size_type size () const
 
ValueSet * top ()
 
const ValueSet * top () const
 
bool validIdx_ (idx_type idx) const
 
virtual ValueType valueType (idx_type) const
 
uiRetVal write (const char *fnm, bool pretty)
 
uiRetVal write (od_ostream &, bool pretty=false)
 
uiRetVal writePretty (od_ostream &)
 

Protected Member Functions

Array * gtArrayByKey (const char *) const
 
Array * gtArrayByKeys (const BufferStringSet &) const
 
ValueSet * gtChildByKey (const char *) const
 
ValueSet * gtChildByKeys (const BufferStringSet &) const
 
Object * gtObjectByKey (const char *) const
 
Object * gtObjectByKeys (const BufferStringSet &) const
 
void set (KeyedValue *)
 
template<class T>
void setVal (const char *, T)
 
void setVS (const char *, ValueSet *)
 
- Protected Member Functions inherited from OD::JSON::ValueSet
 ValueSet (const ValueSet &)
 
 ValueSet (ValueSet *parent)
 
Array * gtArrayByIdx (idx_type) const
 
ValueSet * gtChildByIdx (idx_type) const
 
Object * gtObjectByIdx (idx_type) const
 
void setParent (ValueSet *p)
 
void use (const GasonNode &)
 
void use (const GasonNode &, bool allowmixed)
 

Friends

class ValueSet
 

Additional Inherited Members

- Public Types inherited from OD::JSON::ValueSet
typedef Gason::JsonNode GasonNode
 
typedef size_type idx_type
 
typedef ValArr::size_type size_type
 
enum  ValueType { Data , SubArray , SubObject , Null }
 
- Static Public Member Functions inherited from OD::JSON::ValueSet
static ValueSet * getFromJSon (char *buf, int bufsz, uiRetVal &)
 
static ValueSet * getFromJSon (char *buf, int bufsz, uiRetVal &, bool allowmixedarr)
 
static ValueSet * read (const char *fnm, uiRetVal &)
 
static ValueSet * read (const char *fnm, uiRetVal &, bool allowmixedarr)
 
static ValueSet * read (od_istream &, uiRetVal &)
 
static ValueSet * read (od_istream &, uiRetVal &, bool allowmixedarr)
 
- Static Protected Member Functions inherited from OD::JSON::ValueSet
static ValueSet * gtByParse (char *, int, bool allowmixed, uiRetVal &, ValueSet *)
 
static ValueSet * gtByParse (char *, int, uiRetVal &, ValueSet *)
 
- Protected Attributes inherited from OD::JSON::ValueSet
ValueSet * parent_
 
ObjectSet< Value > values_
 

Detailed Description

ValueSet where the values and subsets have a key.

Constructor & Destructor Documentation

◆ Object() [1/2]

OD::JSON::Object::Object ( ValueSet * p = nullptr)

◆ Object() [2/2]

OD::JSON::Object::Object ( const Object & )

◆ ~Object()

OD::JSON::Object::~Object ( )

Member Function Documentation

◆ clone()

Object * OD::JSON::Object::clone ( ) const
inlineoverridevirtual

Implements OD::JSON::ValueSet.

◆ dType()

DataType OD::JSON::Object::dType ( idx_type ) const

Only for ValueType==Data.

◆ get() [1/12]

template<class T>
bool OD::JSON::Object::get ( const char * key,
Array1D< T > & arr ) const
inline

◆ get() [2/12]

template<class T>
bool OD::JSON::Object::get ( const char * key,
Array2D< T > & arr ) const
inline

◆ get() [3/12]

bool OD::JSON::Object::get ( const char * ,
BoolTypeSet &  ) const

◆ get() [4/12]

bool OD::JSON::Object::get ( const char * ,
BufferStringSet &  ) const

◆ get() [5/12]

bool OD::JSON::Object::get ( const char * ,
Coord &  ) const

◆ get() [6/12]

bool OD::JSON::Object::get ( const char * ,
Coord3 &  ) const

◆ get() [7/12]

bool OD::JSON::Object::get ( const char * ,
DBKeySet &  ) const

◆ get() [8/12]

template<class T>
bool OD::JSON::Object::get ( const char * key,
Interval< T > & intrvl ) const
inline

◆ get() [9/12]

bool OD::JSON::Object::get ( const char * ,
TypeSet< MultiID > &  ) const

◆ get() [10/12]

template<class T>
bool OD::JSON::Object::get ( const char * key,
TypeSet< T > & arr ) const
inline

◆ get() [11/12]

bool OD::JSON::Object::get ( const char * ,
uiStringSet &  ) const

◆ get() [12/12]

bool OD::JSON::Object::get ( const char * ,
::IdxPair &  ) const

◆ getArray() [1/4]

Array * OD::JSON::Object::getArray ( const BufferStringSet & bskey)
inline

◆ getArray() [2/4]

const Array * OD::JSON::Object::getArray ( const BufferStringSet & bskey) const
inline

◆ getArray() [3/4]

Array * OD::JSON::Object::getArray ( const char * ky)
inline

◆ getArray() [4/4]

const Array * OD::JSON::Object::getArray ( const char * ky) const
inline

◆ getBoolValue() [1/3]

bool OD::JSON::Object::getBoolValue ( const char * ) const

◆ getBoolValue() [2/3]

bool OD::JSON::Object::getBoolValue ( const OD::String & str) const
inline

◆ getBoolValue() [3/3]

bool OD::JSON::Object::getBoolValue ( idx_type idx) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getChild() [1/4]

ValueSet * OD::JSON::Object::getChild ( const BufferStringSet & bskey)
inline

◆ getChild() [2/4]

const ValueSet * OD::JSON::Object::getChild ( const BufferStringSet & bskey) const
inline

◆ getChild() [3/4]

ValueSet * OD::JSON::Object::getChild ( const char * ky)
inline

◆ getChild() [4/4]

const ValueSet * OD::JSON::Object::getChild ( const char * ky) const
inline

◆ getDoubleValue() [1/3]

double OD::JSON::Object::getDoubleValue ( const char * ) const

◆ getDoubleValue() [2/3]

double OD::JSON::Object::getDoubleValue ( const OD::String & str) const
inline

◆ getDoubleValue() [3/3]

double OD::JSON::Object::getDoubleValue ( idx_type idx) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getFilePath() [1/3]

FilePath OD::JSON::Object::getFilePath ( const char * ) const

◆ getFilePath() [2/3]

FilePath OD::JSON::Object::getFilePath ( const OD::String & str) const
inline

◆ getFilePath() [3/3]

FilePath OD::JSON::Object::getFilePath ( idx_type idx) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getGeomID()

bool OD::JSON::Object::getGeomID ( const char * ,
Pos::GeomID &  ) const

◆ getIntValue() [1/3]

od_int64 OD::JSON::Object::getIntValue ( const char * ) const

◆ getIntValue() [2/3]

od_int64 OD::JSON::Object::getIntValue ( const OD::String & str) const
inline

◆ getIntValue() [3/3]

od_int64 OD::JSON::Object::getIntValue ( idx_type idx) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getMultiID()

MultiID OD::JSON::Object::getMultiID ( const char * ) const

◆ getObject() [1/4]

Object * OD::JSON::Object::getObject ( const BufferStringSet & bskey)
inline

◆ getObject() [2/4]

const Object * OD::JSON::Object::getObject ( const BufferStringSet & bskey) const
inline

◆ getObject() [3/4]

Object * OD::JSON::Object::getObject ( const char * ky)
inline

◆ getObject() [4/4]

const Object * OD::JSON::Object::getObject ( const char * ky) const
inline

◆ getStrings()

bool OD::JSON::Object::getStrings ( const char * ,
BufferStringSet &  ) const

◆ getStringValue() [1/3]

BufferString OD::JSON::Object::getStringValue ( const char * ) const

◆ getStringValue() [2/3]

BufferString OD::JSON::Object::getStringValue ( const OD::String & str) const
inline

◆ getStringValue() [3/3]

BufferString OD::JSON::Object::getStringValue ( idx_type idx) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getSubObjKeys()

void OD::JSON::Object::getSubObjKeys ( BufferStringSet & ) const

◆ gtArrayByKey()

Array * OD::JSON::Object::gtArrayByKey ( const char * ) const
protected

◆ gtArrayByKeys()

Array * OD::JSON::Object::gtArrayByKeys ( const BufferStringSet & ) const
protected

◆ gtChildByKey()

ValueSet * OD::JSON::Object::gtChildByKey ( const char * ) const
protected

◆ gtChildByKeys()

ValueSet * OD::JSON::Object::gtChildByKeys ( const BufferStringSet & ) const
protected

◆ gtObjectByKey()

Object * OD::JSON::Object::gtObjectByKey ( const char * ) const
protected

◆ gtObjectByKeys()

Object * OD::JSON::Object::gtObjectByKeys ( const BufferStringSet & ) const
protected

◆ indexOf()

idx_type OD::JSON::Object::indexOf ( const char * ) const

◆ isArray()

bool OD::JSON::Object::isArray ( ) const
inlineoverridevirtual

Implements OD::JSON::ValueSet.

◆ isNull()

bool OD::JSON::Object::isNull ( const char * ) const

◆ isPresent()

bool OD::JSON::Object::isPresent ( const char * ky) const
inline

◆ operator=()

Object & OD::JSON::Object::operator= ( const Object & )
delete

◆ remove()

void OD::JSON::Object::remove ( const char * )

◆ set() [1/31]

Array * OD::JSON::Object::set ( const char * ky,
Array *  )

◆ set() [2/31]

void OD::JSON::Object::set ( const char * ky,
bool  )

◆ set() [3/31]

void OD::JSON::Object::set ( const char * ky,
const ::IdxPair &  )

◆ set() [4/31]

template<class T>
void OD::JSON::Object::set ( const char * ky,
const Array1D< T > & arr )
inline

◆ set() [5/31]

template<class T>
void OD::JSON::Object::set ( const char * ky,
const Array2D< T > & arr )
inline

◆ set() [6/31]

void OD::JSON::Object::set ( const char * ky,
const BoolTypeSet &  )

◆ set() [7/31]

void OD::JSON::Object::set ( const char * ky,
const BufferStringSet &  )

◆ set() [8/31]

void OD::JSON::Object::set ( const char * ky,
const char *  )

◆ set() [9/31]

void OD::JSON::Object::set ( const char * ky,
const Coord &  )

◆ set() [10/31]

void OD::JSON::Object::set ( const char * ky,
const Coord3 &  )

◆ set() [11/31]

void OD::JSON::Object::set ( const char * ky,
const DBKey &  )

◆ set() [12/31]

void OD::JSON::Object::set ( const char * ky,
const DBKeySet &  )

◆ set() [13/31]

void OD::JSON::Object::set ( const char * ky,
const FilePath &  )

◆ set() [14/31]

template<class T>
void OD::JSON::Object::set ( const char * ky,
const Interval< T > & intrvl )
inline

◆ set() [15/31]

void OD::JSON::Object::set ( const char * ky,
const MultiID &  )

◆ set() [16/31]

void OD::JSON::Object::set ( const char * ky,
const OD::String & str )
inline

◆ set() [17/31]

void OD::JSON::Object::set ( const char * ky,
const TypeSet< Coord > &  )

◆ set() [18/31]

void OD::JSON::Object::set ( const char * ky,
const TypeSet< Coord3 > &  )

◆ set() [19/31]

void OD::JSON::Object::set ( const char * ky,
const TypeSet< MultiID > &  )

◆ set() [20/31]

template<class T>
void OD::JSON::Object::set ( const char * ky,
const TypeSet< T > & arr )
inline

◆ set() [21/31]

void OD::JSON::Object::set ( const char * ky,
const uiString &  )

◆ set() [22/31]

void OD::JSON::Object::set ( const char * ky,
const uiStringSet &  )

◆ set() [23/31]

void OD::JSON::Object::set ( const char * ky,
double  )

◆ set() [24/31]

void OD::JSON::Object::set ( const char * ky,
float  )

◆ set() [25/31]

Object * OD::JSON::Object::set ( const char * ky,
Object *  )

◆ set() [26/31]

void OD::JSON::Object::set ( const char * ky,
od_int16  )

◆ set() [27/31]

void OD::JSON::Object::set ( const char * ky,
od_int32  )

◆ set() [28/31]

void OD::JSON::Object::set ( const char * ky,
od_int64  )

◆ set() [29/31]

void OD::JSON::Object::set ( const char * ky,
od_uint16  )

◆ set() [30/31]

void OD::JSON::Object::set ( const char * ky,
od_uint32  )

◆ set() [31/31]

void OD::JSON::Object::set ( KeyedValue * )
protected

◆ setNull()

void OD::JSON::Object::setNull ( const char * )

◆ setVal()

template<class T>
void OD::JSON::Object::setVal ( const char * ,
T  )
protected

◆ setVS()

void OD::JSON::Object::setVS ( const char * ,
ValueSet *  )
protected

◆ validIdx()

bool OD::JSON::Object::validIdx ( idx_type idx) const
inline

Friends And Related Symbol Documentation

◆ ValueSet

friend class ValueSet
friend

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