MCPcopy Create free account
hub / github.com/MariaDB/server / SerializeObject

Method SerializeObject

storage/connect/json.cpp:981–1004  ·  view source on GitHub ↗

/ Serialize a JSON Object. */ /

Source from the content-addressed store, hash-verified

979/* Serialize a JSON Object. */
980/***********************************************************************/
981bool JDOC::SerializeObject(PJOB jobp)
982{
983 bool first = true;
984
985 if (js->WriteChr('{'))
986 return true;
987
988 for (PJPR pair = jobp->GetFirst(); pair; pair = pair->Next) {
989 if (first)
990 first = false;
991 else if (js->WriteChr(','))
992 return true;
993
994 if (js->WriteChr('"') ||
995 js->WriteStr(pair->Key) ||
996 js->WriteChr('"') ||
997 js->WriteChr(':') ||
998 SerializeValue(pair->Val))
999 return true;
1000
1001 } // endfor i
1002
1003 return js->WriteChr('}');
1004} // end of SerializeObject
1005
1006/***********************************************************************/
1007/* Serialize a JSON Value. */

Callers 1

SerializeFunction · 0.45

Calls 3

WriteChrMethod · 0.80
WriteStrMethod · 0.80
GetFirstMethod · 0.45

Tested by

no test coverage detected