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

Method MptrJson

storage/connect/json.cpp:1954–1973  ·  view source on GitHub ↗

/ Replace all offsets by pointers. */ /

Source from the content-addressed store, hash-verified

1952/* Replace all offsets by pointers. */
1953/***********************************************************************/
1954PJSON SWAP::MptrJson(PJSON ojp) { // ojp is an offset
1955 PJSON jsp = (PJSON)MakePtr(Base, (size_t)ojp);
1956
1957 if (ojp)
1958 switch (jsp->Type) {
1959 case TYPE_JAR:
1960 jsp = MptrArray((PJAR)ojp);
1961 break;
1962 case TYPE_JOB:
1963 jsp = MptrObject((PJOB)ojp);
1964 break;
1965 case TYPE_JVAL:
1966 jsp = MptrJValue((PJVAL)ojp);
1967 break;
1968 default:
1969 throw "Invalid json tree";
1970 } // endswitch Type
1971
1972 return jsp;
1973} // end of MptrJson
1974
1975/***********************************************************************/
1976/* Replace all array offsets by pointers. */

Callers

nothing calls this directly

Calls 1

MakePtrFunction · 0.85

Tested by

no test coverage detected