MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / RewriteConfigToText

Function RewriteConfigToText

src/benchmark/Performance.cpp:240–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void RewriteConfigToText(JSONValue& node, JSONDocument::AllocatorType& allocator,
241 const char* target_type) {
242 if (node.IsObject()) {
243 auto type_member = node.FindMember("type");
244 auto file_member = node.FindMember("file");
245 if (type_member != node.MemberEnd() && file_member != node.MemberEnd()) {
246 RewriteDictNode(node, allocator, target_type);
247 }
248
249 for (auto it = node.MemberBegin(); it != node.MemberEnd(); ++it) {
250 RewriteConfigToText(it->value, allocator, target_type);
251 }
252 return;
253 }
254
255 if (node.IsArray()) {
256 for (auto& child : node.GetArray()) {
257 RewriteConfigToText(child, allocator, target_type);
258 }
259 }
260}
261
262void RewriteSegmentationResourcesToAbsolute(
263 JSONValue& node, JSONDocument::AllocatorType& allocator,

Callers 1

CreateMethod · 0.85

Calls 4

RewriteDictNodeFunction · 0.85
FindMemberMethod · 0.80
MemberEndMethod · 0.80
MemberBeginMethod · 0.80

Tested by

no test coverage detected