28 #ifndef CASA_JSONVALUE_H
29 #define CASA_JSONVALUE_H
32 #include <casacore/casa/Arrays/ArrayFwd.h>
33 #include <casacore/casa/BasicSL/String.h>
34 #include <casacore/casa/BasicSL/Complex.h>
35 #include <casacore/casa/Utilities/DataType.h>
36 #include <casacore/casa/Utilities/Assert.h>
37 #include <casacore/casa/Exceptions/Error.h>
239 const std::vector<JsonValue>& vec)
const
241 for (std::vector<JsonValue>::const_iterator iter=vec.begin();
242 iter!=vec.end(); ++iter) {
243 if (iter->dataType() == TpOther) {
244 data =
fillArray (data, dataEnd, iter->getVector());
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
T * fillArray(T *data, const T *dataEnd, const std::vector< JsonValue > &vec) const
Fill an array from nested vector in a recursive way.
JsonValue(const std::vector< JsonValue > &)
Array< String > getArrayString() const
DataType arrayDataType() const
Get the most common data type of the value inside a possibly nested vector.
void get(String &value) const
JsonValue & operator=(const JsonValue &)
Assignment (copy semantics).
Array< DComplex > getArrayDComplex() const
friend ostream & operator<<(ostream &, const JsonValue &)
Show value on given ostream.
DataType dataType() const
Get the data type of the value.
DataType vectorDataType(const std::vector< JsonValue > &vec) const
JsonValue(const JsonValue &)
Copy constructor (copy semantics).
ValueHolder getValueHolder() const
Get the value as a ValueHolder.
void get(std::vector< Int64 > &value) const
Array< Bool > getArrayBool() const
Get the value as an Array.
const JsonKVMap & getValueMap() const
Get the value as a JsonKVMap (no conversion is possible).
void get(JsonKVMap &value) const
std::vector< DComplex > getVecDComplex() const
std::vector< double > getVecDouble() const
JsonValue(const DComplex &)
IPosition shape() const
Get the shape of an array (possibly nested vector).
Array< Int64 > getArrayInt() const
void get(std::vector< Bool > &value) const
Bool isVector() const
Is the value a vector?
void get(Int64 &value) const
JsonValue(const String &)
void get(Bool &value) const
Get functions for templated purposes.
const String & getString() const
void get(std::vector< DComplex > &value) const
void get(double &value) const
Bool getBool() const
Get the value in the given data type.
size_t size() const
Return the size of a value vector or map (1 is returned for a scalar).
DComplex getDComplex() const
const std::vector< JsonValue > & getVector() const
std::vector< Int64 > getVecInt() const
void get(std::vector< double > &value) const
Bool isValueMap() const
Is the value a value map?
JsonValue()
The default constructor results in a null value.
JsonValue(const JsonKVMap &)
std::vector< Bool > getVecBool() const
As above, but get the value as a vector.
Bool isNull() const
Is the value a null value?
void copyValue(const JsonValue &that)
Copy the value from another one.
void get(std::vector< JsonValue > &value) const
std::vector< String > getVecString() const
void clear()
Remove the value.
JsonValue(Bool)
Construct value with given type.
Array< double > getArrayDouble() const
void get(DComplex &value) const
IPosition vectorShape(const std::vector< JsonValue > &vec) const
void get(std::vector< String > &value) const
String: the storage and methods of handling collections of characters.
std::complex< Double > DComplex
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.