MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / newStreamWriter

Method newStreamWriter

src/share/jsoncpp/jsoncpp.cpp:5212–5243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5210StreamWriterBuilder::~StreamWriterBuilder()
5211{}
5212StreamWriter* StreamWriterBuilder::newStreamWriter() const
5213{
5214 JSONCPP_STRING indentation = settings_["indentation"].asString();
5215 JSONCPP_STRING cs_str = settings_["commentStyle"].asString();
5216 bool eyc = settings_["enableYAMLCompatibility"].asBool();
5217 bool dnp = settings_["dropNullPlaceholders"].asBool();
5218 bool usf = settings_["useSpecialFloats"].asBool();
5219 unsigned int pre = settings_["precision"].asUInt();
5220 CommentStyle::Enum cs = CommentStyle::All;
5221 if (cs_str == "All") {
5222 cs = CommentStyle::All;
5223 } else if (cs_str == "None") {
5224 cs = CommentStyle::None;
5225 } else {
5226 throwRuntimeError("commentStyle must be 'All' or 'None'");
5227 }
5228 JSONCPP_STRING colonSymbol = " : ";
5229 if (eyc) {
5230 colonSymbol = ": ";
5231 } else if (indentation.empty()) {
5232 colonSymbol = ":";
5233 }
5234 JSONCPP_STRING nullSymbol = "null";
5235 if (dnp) {
5236 nullSymbol = "";
5237 }
5238 if (pre > 17) pre = 17;
5239 JSONCPP_STRING endingLineFeedSymbol = "";
5240 return new BuiltStyledStreamWriter(
5241 indentation, cs,
5242 colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
5243}
5244static void getValidWriterKeys(std::set<JSONCPP_STRING>* valid_keys)
5245{
5246 valid_keys->clear();

Callers 2

writeStringFunction · 0.80
jsoncpp.cppFile · 0.80

Calls 5

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

Tested by

no test coverage detected