MCPcopy Create free account
hub / github.com/Illumina/paragraph / newStreamWriter

Method newStreamWriter

external/jsoncpp/jsoncpp.cpp:5287–5318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5285StreamWriterBuilder::~StreamWriterBuilder()
5286{}
5287StreamWriter* StreamWriterBuilder::newStreamWriter() const
5288{
5289 JSONCPP_STRING indentation = settings_["indentation"].asString();
5290 JSONCPP_STRING cs_str = settings_["commentStyle"].asString();
5291 bool eyc = settings_["enableYAMLCompatibility"].asBool();
5292 bool dnp = settings_["dropNullPlaceholders"].asBool();
5293 bool usf = settings_["useSpecialFloats"].asBool();
5294 unsigned int pre = settings_["precision"].asUInt();
5295 CommentStyle::Enum cs = CommentStyle::All;
5296 if (cs_str == "All") {
5297 cs = CommentStyle::All;
5298 } else if (cs_str == "None") {
5299 cs = CommentStyle::None;
5300 } else {
5301 throwRuntimeError("commentStyle must be 'All' or 'None'");
5302 }
5303 JSONCPP_STRING colonSymbol = " : ";
5304 if (eyc) {
5305 colonSymbol = ": ";
5306 } else if (indentation.empty()) {
5307 colonSymbol = ":";
5308 }
5309 JSONCPP_STRING nullSymbol = "null";
5310 if (dnp) {
5311 nullSymbol.clear();
5312 }
5313 if (pre > 17) pre = 17;
5314 JSONCPP_STRING endingLineFeedSymbol;
5315 return new BuiltStyledStreamWriter(
5316 indentation, cs,
5317 colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
5318}
5319static void getValidWriterKeys(std::set<JSONCPP_STRING>* valid_keys)
5320{
5321 valid_keys->clear();

Callers 2

writeStringFunction · 0.80
jsoncpp.cppFile · 0.80

Calls 6

throwRuntimeErrorFunction · 0.85
asStringMethod · 0.80
asBoolMethod · 0.80
asUIntMethod · 0.80
emptyMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected