MCPcopy Create free account
hub / github.com/aixed/WeChat-Hook / get_cbor_array

Method get_cbor_array

include/json.hpp:10093–10123  ·  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

10091 @return whether array creation completed
10092 */
10093 bool get_cbor_array(const std::size_t len,
10094 const cbor_tag_handler_t tag_handler)
10095 {
10096 if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len)))
10097 {
10098 return false;
10099 }
10100
10101 if (len != static_cast<std::size_t>(-1))
10102 {
10103 for (std::size_t i = 0; i < len; ++i)
10104 {
10105 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler)))
10106 {
10107 return false;
10108 }
10109 }
10110 }
10111 else
10112 {
10113 while (get() != 0xFF)
10114 {
10115 if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler)))
10116 {
10117 return false;
10118 }
10119 }
10120 }
10121
10122 return sax->end_array();
10123 }
10124
10125 /*!
10126 @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