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