CYCLUS
Loading...
Searching...
No Matches
Json::CustomWriter Class Reference

Detailed Description

Writes a Value in JSON format with custom formatting.

The JSON document is written according to the rules specified in the constructor. Objects and arrays are printed on a single line if they are below a certain length, otherwise they are indented. It is possible to output invalid json if the customizable parameters are specified incorrectly. Set maxWidth to 0 to print output on a single line.

See also
Reader, Value

Definition at line 4696 of file pyne.h.

#include <pyne.h>

Inheritance diagram for Json::CustomWriter:
Json::Writer

Public Member Functions

 CustomWriter (std::string opencurly="{", std::string closecurly="}", std::string opensquare="[", std::string closesquare="]", std::string colon=":", std::string comma=",", std::string indent=" ", int maxWidth=74)
 
virtual std::string write (const Value &root)
 
virtual ~CustomWriter ()
 
- Public Member Functions inherited from Json::Writer
virtual ~Writer ()
 

Constructor & Destructor Documentation

◆ CustomWriter()

Json::CustomWriter::CustomWriter ( std::string opencurly = "{",
std::string closecurly = "}",
std::string opensquare = "[",
std::string closesquare = "]",
std::string colon = ":",
std::string comma = ",",
std::string indent = "  ",
int maxWidth = 74 )

Definition at line 16867 of file pyne.cc.

◆ ~CustomWriter()

virtual Json::CustomWriter::~CustomWriter ( )
inlinevirtual

Definition at line 4707 of file pyne.h.

Member Function Documentation

◆ write()

std::string Json::CustomWriter::write ( const Value & root)
virtual

Implements Json::Writer.

Definition at line 16888 of file pyne.cc.


The documentation for this class was generated from the following files: