28 #ifndef CASA_JSONOUT_H
29 #define CASA_JSONOUT_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicSL/String.h>
34 #include <casacore/casa/Arrays/Array.h>
35 #include <casacore/casa/BasicSL/Complex.h>
36 #include <casacore/casa/vector.h>
133 const String& indent=
" ");
154 template <
typename T>
186 template <
typename T>
191 template <
typename T>
210 template <
typename T>
214 template <
typename T>
243 #ifndef CASACORE_NO_AUTO_TEMPLATES
244 #include <casacore/casa/Json/JsonOut.tcc>
void put(const String &value)
JsonOut(ostream &os)
Create the object using the given ostream object.
void writeKV(const String &name, const Array< T > &value)
Write a key and array value.
JsonOut(const String &name)
Create the file with the given name using an ofstream object.
void writeKV(const String &name, T value)
General function to write a key and value.
void writeKV(const String &name, const ValueHolder &vh)
Write a key and valueholder.
JsonOut & operator=(const JsonOut &other)
Assignment cannot be used.
void writeComment(const String &comment)
Write a comment on a separate line.
~JsonOut()
Close the stream.
void put(const char *value)
void startNested(const String &name, const String &comment=String())
Start a nested structure; i.e., a field with a structured value.
void putArray(const Array< T > &value, const String &indent, Bool firstLine, Bool valueEndl)
void start(const String &commentStart=String(), const String &commentEnd=String(), const String &indent=" ")
Start a JSON structure by writing a { and setting the indentation.
void putName(const String &name)
Write the name.
void put(const Complex &value)
void put(const Record &)
Put a Record which is written as a {} structure.
void write(const String &name, T value, const String &comment=String())
Write one or more lines defining a keyword-value pair, where value can be of any type including Array...
JsonOut()
The default constructor creates the output on stdout.
void put(const DComplex &value)
JsonOut(const JsonOut &other)
Copy constructor cannot be used.
vector< Bool > itsFirstName
void putNull()
Write a null value.
void putArray(const Array< String > &value, const String &indent, Bool firstLine)
void putArray(const Array< T > &value, const String &indent, Bool firstLine)
Put a line defining an array value.
static String escapeString(const String &in)
Escape special characters (including control characters) in a string.
String indentValue(const String &indent, const String &name) const
Get the indentation after a name.
void put(T value)
Put a scalar value with sufficient accuracy.
void end()
End a structure by clearing the indentation and writing a }.
void endNested()
End a nested structure.
String: the storage and methods of handling collections of characters.
std::complex< Float > Complex
std::complex< Double > DComplex
this file contains all the compiler specific defines
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.