| 57 | class Entry; |
| 58 | |
| 59 | struct File { |
| 60 | TimePoint mtime; |
| 61 | std::string name; |
| 62 | std::shared_ptr<Buffer> data; |
| 63 | std::shared_ptr<const KeyValueMetadata> metadata; |
| 64 | |
| 65 | File(TimePoint mtime, std::string name) : mtime(mtime), name(std::move(name)) {} |
| 66 | |
| 67 | int64_t size() const { return data ? data->size() : 0; } |
| 68 | |
| 69 | explicit operator std::string_view() const { |
| 70 | if (data) { |
| 71 | return std::string_view(*data); |
| 72 | } else { |
| 73 | return ""; |
| 74 | } |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | struct Directory { |
| 79 | std::string name; |
no outgoing calls