MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / get_cbor_array

Method get_cbor_array

external/json/json.hpp:7117–7146  ·  view source on GitHub ↗

! @param[in] len the length of the array or std::size_t(-1) for an array of indefinite size @return whether array creation completed */

Source from the content-addressed store, hash-verified

7115 @return whether array creation completed
7116 */
7117 bool get_cbor_array(const std::size_t len)
7118 {
7119 if (JSON_UNLIKELY(not sax->start_array(len)))
7120 {
7121 return false;
7122 }
7123
7124 if (len != std::size_t(-1))
7125 {
7126 for (std::size_t i = 0; i < len; ++i)
7127 {
7128 if (JSON_UNLIKELY(not parse_cbor_internal()))
7129 {
7130 return false;
7131 }
7132 }
7133 }
7134 else
7135 {
7136 while (get() != 0xFF)
7137 {
7138 if (JSON_UNLIKELY(not parse_cbor_internal(false)))
7139 {
7140 return false;
7141 }
7142 }
7143 }
7144
7145 return sax->end_array();
7146 }
7147
7148 /*!
7149 @param[in] len the length of the object or std::size_t(-1) for an

Callers

nothing calls this directly

Calls 3

getFunction · 0.85
start_arrayMethod · 0.45
end_arrayMethod · 0.45

Tested by

no test coverage detected