MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / get_cbor_object

Method get_cbor_object

native/thirdpart/json/json.hpp:5964–6007  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

5962 @return whether object creation completed
5963 */
5964 bool get_cbor_object(const std::size_t len)
5965 {
5966 if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len)))
5967 {
5968 return false;
5969 }
5970
5971 string_t key;
5972 if (len != std::size_t(-1))
5973 {
5974 for (std::size_t i = 0; i < len; ++i)
5975 {
5976 get();
5977 if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
5978 {
5979 return false;
5980 }
5981
5982 if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal()))
5983 {
5984 return false;
5985 }
5986 key.clear();
5987 }
5988 }
5989 else
5990 {
5991 while (get() != 0xFF)
5992 {
5993 if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
5994 {
5995 return false;
5996 }
5997
5998 if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal()))
5999 {
6000 return false;
6001 }
6002 key.clear();
6003 }
6004 }
6005
6006 return sax->end_object();
6007 }
6008
6009 /////////////
6010 // MsgPack //

Callers

nothing calls this directly

Calls 4

getFunction · 0.85
start_objectMethod · 0.45
keyMethod · 0.45
end_objectMethod · 0.45

Tested by

no test coverage detected