MCPcopy Create free account
hub / github.com/USCiLab/cereal / JSONOutputArchive

Method JSONOutputArchive

include/cereal/archives/json.hpp:160–170  ·  view source on GitHub ↗

Construct, outputting to the provided stream ! @param stream The stream to output to. @param options The JSON specific options to use. See the Options struct for the values of default parameters */

Source from the content-addressed store, hash-verified

158 @param options The JSON specific options to use. See the Options struct
159 for the values of default parameters */
160 JSONOutputArchive(std::ostream & stream, Options const & options = Options::Default() ) :
161 OutputArchive<JSONOutputArchive>(this),
162 itsWriteStream(stream),
163 itsWriter(itsWriteStream),
164 itsNextName(nullptr)
165 {
166 itsWriter.SetMaxDecimalPlaces( options.itsPrecision );
167 itsWriter.SetIndent( options.itsIndentChar, options.itsIndentLength );
168 itsNameCounter.push(0);
169 itsNodeStack.push(NodeType::StartObject);
170 }
171
172 //! Destructor, flushes the JSON
173 ~JSONOutputArchive() CEREAL_NOEXCEPT

Callers

nothing calls this directly

Calls 1

SetMaxDecimalPlacesMethod · 0.80

Tested by

no test coverage detected