MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / get_cbor_array

Method get_cbor_array

extern/json/json.hpp:10180–10210  ·  view source on GitHub ↗

! @param[in] len the length of the array or static_cast (-1) for an array of indefinite size @param[in] tag_handler how CBOR tags should be treated @return whether array creation completed */

Source from the content-addressed store, hash-verified

10178 @return whether array creation completed
10179 */
10180 bool get_cbor_array(const std::size_t len,
10181 const cbor_tag_handler_t tag_handler)
10182 {
10183 if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len)))
10184 {
10185 return false;
10186 }
10187
10188 if (len != static_cast<std::size_t>(-1))
10189 {
10190 for (std::size_t i = 0; i < len; ++i)
10191 {
10192 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler)))
10193 {
10194 return false;
10195 }
10196 }
10197 }
10198 else
10199 {
10200 while (get() != 0xFF)
10201 {
10202 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler)))
10203 {
10204 return false;
10205 }
10206 }
10207 }
10208
10209 return sax->end_array();
10210 }
10211
10212 /*!
10213 @param[in] len the length of the object or static_cast<std::size_t>(-1) for an

Callers

nothing calls this directly

Calls 3

getFunction · 0.70
start_arrayMethod · 0.45
end_arrayMethod · 0.45

Tested by

no test coverage detected