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