Celeritas 0.7.0-dev.558+develop.788a828f7
Loading...
Searching...
No Matches
Typedefs | Functions
OutputInterface.cc File Reference
#include "OutputInterface.hh"
#include <iostream>
#include <nlohmann/json.hpp>
#include "EnumStringMapper.hh"
#include "JsonPimpl.hh"
#include "StreamUtils.hh"

Typedefs

using Category = celeritas::OutputInterface::Category
 

Functions

char const * celeritas::to_cstring (Category value)
 Get a string corresponding to a category.
 
std::string celeritas::to_string (OutputInterface const &output)
 Get the JSON representation of a single output.
 
std::ostream & celeritas::operator<< (std::ostream &os, OutputInterface const &output)
 Stream the JSON representation of a single output.
 

Function Documentation

◆ operator<<()

std::ostream & celeritas::operator<< ( std::ostream &  os,
OutputInterface const &  output 
)

Stream the JSON representation of a single output.

This uses the underlying nljson output routine, so you can use std::setw to enable pretty-printing. The default is to print to a single line.

◆ to_string()

std::string celeritas::to_string ( OutputInterface const &  output)

Get the JSON representation of a single output.

This is used mostly for testing, but it can also be useful for quickly generating useful JSON output from applications, e.g. with exception output.