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

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

#include <odjson.h>

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

Public Member Functions

 Array (bool objects, ValueSet *p=0)
 
 Array (const Array &)
 
 Array (DataType, ValueSet *p=0)
 
 ~Array ()
 
Array * add (Array *)
 
Array & add (bool)
 
Array & add (const char *)
 
Array & add (const DBKey &)
 
Array & add (const double *, size_type)
 
Array & add (const FilePath &)
 
Array & add (const float *, size_type)
 
Array & add (const MultiID &)
 
Array & add (const OD::String &)
 
Array & add (const od_int16 *, size_type)
 
Array & add (const od_int32 *, size_type)
 
Array & add (const od_int64 *, size_type)
 
Array & add (const od_uint16 *, size_type)
 
Array & add (const od_uint32 *, size_type)
 
Array & add (const TypeSet< Coord > &)
 
Array & add (const TypeSet< Coord3 > &)
 
Array & add (const TypeSet< double > &)
 
Array & add (const TypeSet< float > &)
 
Array & add (const TypeSet< od_int16 > &)
 
Array & add (const TypeSet< od_int32 > &)
 
Array & add (const TypeSet< od_int64 > &)
 
Array & add (const TypeSet< od_uint16 > &)
 
Array & add (const TypeSet< od_uint32 > &)
 
Array & add (const uiString &)
 
Array & add (Coord)
 
Array & add (Coord3)
 
Array & add (double)
 
Array & add (float)
 
Object * add (Object *)
 
Array & add (od_int16)
 
Array & add (od_int32)
 
Array & add (od_int64)
 
Array & add (od_uint16)
 
Array & add (od_uint32)
 
template<class T>
OD::JSON::Array & addVals (const T *vals, size_type sz)
 
template<class T>
OD::JSON::Array & addVals (const TypeSet< T > &vals)
 
Array * clone () const override
 
DataType dataType () const
 
DataType dType (idx_type) const
 Only for ValueType==Data.
 
BufferString dumpJSon (bool pretty=false) const override
 
void dumpJSon (StringBuilder &) const override
 
bool get (::IdxPair &) const
 
bool get (BoolTypeSet &) const
 
bool get (BufferStringSet &) const
 
bool get (Coord &) const
 
bool get (Coord3 &) const
 
bool get (DBKeySet &) const
 
bool get (TypeSet< Coord > &) const
 
bool get (TypeSet< Coord3 > &) const
 
bool get (TypeSet< FilePath > &) const
 
bool get (TypeSet< MultiID > &) const
 
template<class T>
bool get (TypeSet< T > &) const
 
bool get (uiStringSet &) const
 
bool getBoolValue (idx_type) const override
 
double getDoubleValue (idx_type) const override
 
FilePath getFilePath (idx_type) const override
 
od_int64 getIntValue (idx_type) const override
 
BufferString getStringValue (idx_type) const override
 
bool isArray () const override
 
bool isData () const
 
bool isEmpty () const override
 
bool isMixed () const
 
Array & operator= (const Array &)=delete
 
Array & set (bool)
 
Array & set (const bool *, size_type)
 
Array & set (const BoolTypeSet &)
 
Array & set (const BufferStringSet &)
 
Array & set (const char *)
 
Array & set (const DBKey &)
 
Array & set (const DBKeySet &)
 
Array & set (const double *, size_type)
 
Array & set (const FilePath &)
 
Array & set (const FilePath &, idx_type)
 
Array & set (const float *, size_type)
 
Array & set (const MultiID &)
 
Array & set (const OD::String &)
 
Array & set (const od_int16 *, size_type)
 
Array & set (const od_int32 *, size_type)
 
Array & set (const od_int64 *, size_type)
 
Array & set (const od_uint16 *, size_type)
 
Array & set (const od_uint32 *, size_type)
 
Array & set (const TypeSet< double > &)
 
Array & set (const TypeSet< FilePath > &)
 
Array & set (const TypeSet< float > &)
 
Array & set (const TypeSet< MultiID > &)
 
Array & set (const TypeSet< od_int16 > &)
 
Array & set (const TypeSet< od_int32 > &)
 
Array & set (const TypeSet< od_int64 > &)
 
Array & set (const TypeSet< od_uint16 > &)
 
Array & set (const TypeSet< od_uint32 > &)
 
Array & set (const uiString &)
 
Array & set (const uiStringSet &)
 
Array & set (double)
 
Array & set (float)
 
Array & set (od_int16)
 
Array & set (od_int32)
 
Array & set (od_int64)
 
Array & set (od_uint16)
 
Array & set (od_uint32)
 
void setEmpty () override
 
template<class T>
OD::JSON::Array & setVals (const T *vals, size_type sz)
 
size_type size () const override
 
ValArr & valArr ()
 
const ValArr & valArr () const
 
bool validIdx (idx_type) const
 
ValueType valType () const
 
ValueType valueType (idx_type) const override
 
- 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
 
void dumpJSon (BufferString &, bool pretty=false) const
 
bool isArrayChild (idx_type i) 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)
 
ValueSet * top ()
 
const ValueSet * top () const
 
bool validIdx_ (idx_type idx) const
 
uiRetVal write (const char *fnm, bool pretty)
 
uiRetVal write (od_ostream &, bool pretty=false)
 
uiRetVal writePretty (od_ostream &)
 

Protected Member Functions

template<class T>
Array & addVals (const T *, size_type)
 
template<class T>
Array & addVals (const TypeSet< T > &)
 
void addVS (ValueSet *)
 
template<class T>
Array & setVals (const T *, size_type)
 
template<class T>
Array & setVals (const TypeSet< T > &)
 
- 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)
 

Protected Attributes

ValArr * valarr_
 
ValueType valtype_
 
- Protected Attributes inherited from OD::JSON::ValueSet
ValueSet * parent_
 
ObjectSet< Value > values_
 

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 *)
 

Detailed Description

ValueSet where the values and subsets have no key.

If it holds plain data (valType()==Data), then you can only add plain values or set all at once. Otherwise, you can only add ValueSet's of the same type (either Array or Object).

Constructor & Destructor Documentation

◆ Array() [1/3]

OD::JSON::Array::Array ( bool objects,
ValueSet * p = 0 )

◆ Array() [2/3]

OD::JSON::Array::Array ( DataType ,
ValueSet * p = 0 )

◆ Array() [3/3]

OD::JSON::Array::Array ( const Array & )

◆ ~Array()

OD::JSON::Array::~Array ( )

Member Function Documentation

◆ add() [1/34]

Array * OD::JSON::Array::add ( Array * )

◆ add() [2/34]

Array & OD::JSON::Array::add ( bool )

◆ add() [3/34]

Array & OD::JSON::Array::add ( const char * )

◆ add() [4/34]

Array & OD::JSON::Array::add ( const DBKey & )

◆ add() [5/34]

Array & OD::JSON::Array::add ( const double * ,
size_type  )

◆ add() [6/34]

Array & OD::JSON::Array::add ( const FilePath & )

◆ add() [7/34]

Array & OD::JSON::Array::add ( const float * ,
size_type  )

◆ add() [8/34]

Array & OD::JSON::Array::add ( const MultiID & )

◆ add() [9/34]

Array & OD::JSON::Array::add ( const OD::String & )

◆ add() [10/34]

Array & OD::JSON::Array::add ( const od_int16 * ,
size_type  )

◆ add() [11/34]

Array & OD::JSON::Array::add ( const od_int32 * ,
size_type  )

◆ add() [12/34]

Array & OD::JSON::Array::add ( const od_int64 * ,
size_type  )

◆ add() [13/34]

Array & OD::JSON::Array::add ( const od_uint16 * ,
size_type  )

◆ add() [14/34]

Array & OD::JSON::Array::add ( const od_uint32 * ,
size_type  )

◆ add() [15/34]

Array & OD::JSON::Array::add ( const TypeSet< Coord > & )

◆ add() [16/34]

Array & OD::JSON::Array::add ( const TypeSet< Coord3 > & )

◆ add() [17/34]

Array & OD::JSON::Array::add ( const TypeSet< double > & )

◆ add() [18/34]

Array & OD::JSON::Array::add ( const TypeSet< float > & )

◆ add() [19/34]

Array & OD::JSON::Array::add ( const TypeSet< od_int16 > & )

◆ add() [20/34]

Array & OD::JSON::Array::add ( const TypeSet< od_int32 > & )

◆ add() [21/34]

Array & OD::JSON::Array::add ( const TypeSet< od_int64 > & )

◆ add() [22/34]

Array & OD::JSON::Array::add ( const TypeSet< od_uint16 > & )

◆ add() [23/34]

Array & OD::JSON::Array::add ( const TypeSet< od_uint32 > & )

◆ add() [24/34]

Array & OD::JSON::Array::add ( const uiString & )

◆ add() [25/34]

Array & OD::JSON::Array::add ( Coord )

◆ add() [26/34]

Array & OD::JSON::Array::add ( Coord3 )

◆ add() [27/34]

Array & OD::JSON::Array::add ( double )

◆ add() [28/34]

Array & OD::JSON::Array::add ( float )

◆ add() [29/34]

Object * OD::JSON::Array::add ( Object * )

◆ add() [30/34]

Array & OD::JSON::Array::add ( od_int16 )

◆ add() [31/34]

Array & OD::JSON::Array::add ( od_int32 )

◆ add() [32/34]

Array & OD::JSON::Array::add ( od_int64 )

◆ add() [33/34]

Array & OD::JSON::Array::add ( od_uint16 )

◆ add() [34/34]

Array & OD::JSON::Array::add ( od_uint32 )

◆ addVals() [1/4]

template<class T>
Array & OD::JSON::Array::addVals ( const T * ,
size_type  )
protected

◆ addVals() [2/4]

template<class T>
OD::JSON::Array & OD::JSON::Array::addVals ( const T * vals,
size_type sz )

◆ addVals() [3/4]

template<class T>
Array & OD::JSON::Array::addVals ( const TypeSet< T > & )
protected

◆ addVals() [4/4]

template<class T>
OD::JSON::Array & OD::JSON::Array::addVals ( const TypeSet< T > & vals)

◆ addVS()

void OD::JSON::Array::addVS ( ValueSet * )
protected

◆ clone()

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

Implements OD::JSON::ValueSet.

◆ dataType()

DataType OD::JSON::Array::dataType ( ) const

Only available if valType() == Data and not using mixed-type arrays

◆ dType()

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

Only for ValueType==Data.

◆ dumpJSon() [1/2]

BufferString OD::JSON::Array::dumpJSon ( bool pretty = false) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ dumpJSon() [2/2]

void OD::JSON::Array::dumpJSon ( StringBuilder & ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ get() [1/12]

bool OD::JSON::Array::get ( ::IdxPair & ) const

◆ get() [2/12]

bool OD::JSON::Array::get ( BoolTypeSet & ) const

◆ get() [3/12]

bool OD::JSON::Array::get ( BufferStringSet & ) const

◆ get() [4/12]

bool OD::JSON::Array::get ( Coord & ) const

◆ get() [5/12]

bool OD::JSON::Array::get ( Coord3 & ) const

◆ get() [6/12]

bool OD::JSON::Array::get ( DBKeySet & ) const

◆ get() [7/12]

bool OD::JSON::Array::get ( TypeSet< Coord > & ) const

◆ get() [8/12]

bool OD::JSON::Array::get ( TypeSet< Coord3 > & ) const

◆ get() [9/12]

bool OD::JSON::Array::get ( TypeSet< FilePath > & ) const

◆ get() [10/12]

bool OD::JSON::Array::get ( TypeSet< MultiID > & ) const

◆ get() [11/12]

template<class T>
bool OD::JSON::Array::get ( TypeSet< T > & arr) const
inline

◆ get() [12/12]

bool OD::JSON::Array::get ( uiStringSet & ) const

◆ getBoolValue()

bool OD::JSON::Array::getBoolValue ( idx_type ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getDoubleValue()

double OD::JSON::Array::getDoubleValue ( idx_type ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getFilePath()

FilePath OD::JSON::Array::getFilePath ( idx_type ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getIntValue()

od_int64 OD::JSON::Array::getIntValue ( idx_type ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ getStringValue()

BufferString OD::JSON::Array::getStringValue ( idx_type ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ isArray()

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

Implements OD::JSON::ValueSet.

◆ isData()

bool OD::JSON::Array::isData ( ) const

◆ isEmpty()

bool OD::JSON::Array::isEmpty ( ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ isMixed()

bool OD::JSON::Array::isMixed ( ) const

◆ operator=()

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

◆ set() [1/36]

Array & OD::JSON::Array::set ( bool )

◆ set() [2/36]

Array & OD::JSON::Array::set ( const bool * ,
size_type  )

◆ set() [3/36]

Array & OD::JSON::Array::set ( const BoolTypeSet & )

◆ set() [4/36]

Array & OD::JSON::Array::set ( const BufferStringSet & )

◆ set() [5/36]

Array & OD::JSON::Array::set ( const char * )

◆ set() [6/36]

Array & OD::JSON::Array::set ( const DBKey & )

◆ set() [7/36]

Array & OD::JSON::Array::set ( const DBKeySet & )

◆ set() [8/36]

Array & OD::JSON::Array::set ( const double * ,
size_type  )

◆ set() [9/36]

Array & OD::JSON::Array::set ( const FilePath & )

◆ set() [10/36]

Array & OD::JSON::Array::set ( const FilePath & ,
idx_type  )

◆ set() [11/36]

Array & OD::JSON::Array::set ( const float * ,
size_type  )

◆ set() [12/36]

Array & OD::JSON::Array::set ( const MultiID & )

◆ set() [13/36]

Array & OD::JSON::Array::set ( const OD::String & )

◆ set() [14/36]

Array & OD::JSON::Array::set ( const od_int16 * ,
size_type  )

◆ set() [15/36]

Array & OD::JSON::Array::set ( const od_int32 * ,
size_type  )

◆ set() [16/36]

Array & OD::JSON::Array::set ( const od_int64 * ,
size_type  )

◆ set() [17/36]

Array & OD::JSON::Array::set ( const od_uint16 * ,
size_type  )

◆ set() [18/36]

Array & OD::JSON::Array::set ( const od_uint32 * ,
size_type  )

◆ set() [19/36]

Array & OD::JSON::Array::set ( const TypeSet< double > & )

◆ set() [20/36]

Array & OD::JSON::Array::set ( const TypeSet< FilePath > & )

◆ set() [21/36]

Array & OD::JSON::Array::set ( const TypeSet< float > & )

◆ set() [22/36]

Array & OD::JSON::Array::set ( const TypeSet< MultiID > & )

◆ set() [23/36]

Array & OD::JSON::Array::set ( const TypeSet< od_int16 > & )

◆ set() [24/36]

Array & OD::JSON::Array::set ( const TypeSet< od_int32 > & )

◆ set() [25/36]

Array & OD::JSON::Array::set ( const TypeSet< od_int64 > & )

◆ set() [26/36]

Array & OD::JSON::Array::set ( const TypeSet< od_uint16 > & )

◆ set() [27/36]

Array & OD::JSON::Array::set ( const TypeSet< od_uint32 > & )

◆ set() [28/36]

Array & OD::JSON::Array::set ( const uiString & )

◆ set() [29/36]

Array & OD::JSON::Array::set ( const uiStringSet & )

◆ set() [30/36]

Array & OD::JSON::Array::set ( double )

◆ set() [31/36]

Array & OD::JSON::Array::set ( float )

◆ set() [32/36]

Array & OD::JSON::Array::set ( od_int16 )

◆ set() [33/36]

Array & OD::JSON::Array::set ( od_int32 )

◆ set() [34/36]

Array & OD::JSON::Array::set ( od_int64 )

◆ set() [35/36]

Array & OD::JSON::Array::set ( od_uint16 )

◆ set() [36/36]

Array & OD::JSON::Array::set ( od_uint32 )

◆ setEmpty()

void OD::JSON::Array::setEmpty ( )
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ setVals() [1/3]

template<class T>
Array & OD::JSON::Array::setVals ( const T * ,
size_type  )
protected

◆ setVals() [2/3]

template<class T>
OD::JSON::Array & OD::JSON::Array::setVals ( const T * vals,
size_type sz )

◆ setVals() [3/3]

template<class T>
Array & OD::JSON::Array::setVals ( const TypeSet< T > & vals)
protected

◆ size()

size_type OD::JSON::Array::size ( ) const
overridevirtual

Reimplemented from OD::JSON::ValueSet.

◆ valArr() [1/2]

ValArr & OD::JSON::Array::valArr ( )
inline

◆ valArr() [2/2]

const ValArr & OD::JSON::Array::valArr ( ) const
inline

◆ validIdx()

bool OD::JSON::Array::validIdx ( idx_type ) const

◆ valType()

ValueType OD::JSON::Array::valType ( ) const
inline

◆ valueType()

ValueType OD::JSON::Array::valueType ( idx_type ) const
inlineoverridevirtual

Reimplemented from OD::JSON::ValueSet.

Friends And Related Symbol Documentation

◆ ValueSet

friend class ValueSet
friend

Member Data Documentation

◆ valarr_

ValArr* OD::JSON::Array::valarr_
protected

◆ valtype_

ValueType OD::JSON::Array::valtype_
protected

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