MCPcopy Create free account
hub / github.com/Kitware/VTK / GetIntArray

Function GetIntArray

IO/OMF/core/OMFHelpers.cxx:103–125  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

101
102//------------------------------------------------------------------------------
103bool GetIntArray(const Json::Value& root, std::vector<int>& value)
104{
105 if (root.empty() || !root.isArray())
106 {
107 return false;
108 }
109 value.reserve(root.size());
110 for (const auto& intValue : root)
111 {
112 if (intValue.empty() && !intValue.isInt())
113 {
114 value.clear();
115 return false;
116 }
117 value.push_back(intValue.asInt());
118 }
119 if (value.empty())
120 {
121 value.clear();
122 return false;
123 }
124 return true;
125}
126
127//------------------------------------------------------------------------------
128bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value)

Callers

nothing calls this directly

Calls 8

isArrayMethod · 0.80
isIntMethod · 0.80
asIntMethod · 0.80
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected