MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / decodePrefixedString

Function decodePrefixedString

Source/JSON/jsoncpp.cpp:2295–2305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2293 return newString;
2294}
2295inline static void decodePrefixedString(
2296 bool isPrefixed, char const* prefixed,
2297 unsigned* length, char const** value) {
2298 if (!isPrefixed) {
2299 *length = static_cast<unsigned>(strlen(prefixed));
2300 *value = prefixed;
2301 } else {
2302 *length = *reinterpret_cast<unsigned const*>(prefixed);
2303 *value = prefixed + sizeof(unsigned);
2304 }
2305}
2306/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
2307 */
2308static inline void releaseStringValue(char* value) { OG_FREE(value); }

Callers 7

ValueMethod · 0.70
operator<Method · 0.70
operator==Method · 0.70
asCStringMethod · 0.70
getStringMethod · 0.70
asStringMethod · 0.70
asConstStringMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected