1 #ifndef IPFS_DAG_CBOR_VALUE_H_
2 #define IPFS_DAG_CBOR_VALUE_H_
4 #include <ipfs_client/cid.h>
17 virtual std::unique_ptr<DagCborValue> at(std::string_view)
const = 0;
18 virtual std::optional<std::uint64_t> as_unsigned()
const = 0;
19 virtual std::optional<std::int64_t> as_signed()
const = 0;
20 virtual std::optional<double> as_float()
const = 0;
21 virtual std::optional<std::string> as_string()
const = 0;
22 virtual std::optional<std::vector<std::uint8_t>> as_bytes()
const = 0;
23 virtual std::optional<bool> as_bool()
const = 0;
24 virtual std::optional<Cid> as_link()
const = 0;
25 virtual bool is_map()
const = 0;
26 virtual bool is_array()
const = 0;
27 using MapElementCallback = std::function<void(std::string_view,
DagCborValue const&)>;
28 using ArrayElementCallback = std::function<void(
DagCborValue const&)>;
29 virtual void iterate_map(MapElementCallback)
const = 0;
30 virtual void iterate_array(ArrayElementCallback)
const = 0;
31 std::string html()
const;
32 void html(std::ostream&)
const;
Definition: dag_cbor_value.h:15