ipfs-chromium
car.h
1 #ifndef IPFS_CAR_H_
2 #define IPFS_CAR_H_
3 
4 #include <ipfs_client/cid.h>
5 #include <ipfs_client/ctx/cbor_parser.h>
6 #include <vocab/byte_view.h>
7 
8 #include <memory>
9 #include <optional>
10 
11 namespace ipfs {
12 class Client;
17 class Car {
18  public:
23  Car(ByteView bytes, ctx::CborParser& cbor_parser);
24 
27  struct Block {
29  ByteView bytes;
30  };
34  std::optional<Block> NextBlock();
35 
36  private:
37  ByteView data_;
38 };
39 } // namespace ipfs
40 
41 #endif // IPFS_CAR_H_
Definition: car.h:17
Car(ByteView bytes, ctx::CborParser &cbor_parser)
std::optional< Block > NextBlock()
Definition: cid.h:16
Definition: cbor_parser.h:15
Definition: car.h:27
ByteView bytes
The raw bytes that get hashed for the CID.
Definition: car.h:29
Cid cid
The Content ID of the block.
Definition: car.h:28