30#include <casacore/casa/aips.h>
31#include <casacore/casa/BasicSL/String.h>
32#include <casacore/casa/Arrays/Array.h>
33#include <casacore/casa/BasicSL/Complex.h>
34#include <casacore/casa/vector.h>
128 const String& indent =
" ");
149 template <
typename T>
166 template <
typename T>
182 template <
typename T>
185 template <
typename T>
203 template <
typename T>
207 template <
typename T>
235#ifndef CASACORE_NO_AUTO_TEMPLATES
236#include <casacore/casa/Json/JsonOut.tcc>
void put(const String &value)
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.
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.
String indentValue(const std::string &indent, const std::string &name) const
Get the indentation after a name.
void put(const Complex &value)
JsonOut & operator=(const JsonOut &other)
Assignment cannot be used.
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(std::ostream &os)
Create the object using the given ostream object.
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.
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.
For temporary backward namespace compatibility, use casa as alias for casacore.
String name() const
Return the name of the field.
const String & comment(const RecordFieldId &) const override
Get the comment for this field.
bool Bool
Define the standard types used by Casacore.
NewDelAllocator< T > NewDelAllocator< T >::value