MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / jsonToSize

Function jsonToSize

source/core/StarJsonExtra.cpp:7–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace Star {
6
7size_t jsonToSize(Json const& v) {
8 if (v.isNull())
9 return NPos;
10
11 if (!v.canConvert(Json::Type::Int))
12 throw JsonException("Json not an int in jsonToSize");
13
14 return v.toUInt();
15}
16
17Json jsonFromSize(size_t s) {
18 if (s == NPos)

Callers 1

readStoredDataMethod · 0.85

Calls 3

canConvertMethod · 0.80
toUIntMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected