[Yunq] Add support for repeated nested fields
This commit is contained in:
parent
05f2403dc2
commit
9c860dd6a4
14 changed files with 207 additions and 61 deletions
|
|
@ -94,8 +94,10 @@ glcr::ErrorOr<mmth::OwnedMemoryRegion> Ext2BlockReader::ReadBlocks(
|
|||
i++;
|
||||
curr_run_len++;
|
||||
}
|
||||
req.add_lba(curr_start);
|
||||
req.add_sector_cnt(curr_run_len * SectorsPerBlock());
|
||||
DiskBlock block;
|
||||
block.set_lba(curr_start);
|
||||
block.set_size(curr_run_len * SectorsPerBlock());
|
||||
req.add_blocks(glcr::Move(block));
|
||||
}
|
||||
ReadResponse resp;
|
||||
auto status = denali_.ReadMany(req, resp);
|
||||
|
|
|
|||
|
|
@ -16,13 +16,16 @@ class OpenFileRequest {
|
|||
OpenFileRequest() {}
|
||||
// Delete copy and move until implemented.
|
||||
OpenFileRequest(const OpenFileRequest&) = delete;
|
||||
OpenFileRequest(OpenFileRequest&&) = delete;
|
||||
OpenFileRequest(OpenFileRequest&&) = default;
|
||||
OpenFileRequest& operator=(OpenFileRequest&&) = default;
|
||||
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message);
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
|
||||
const glcr::String& path() const { return path_; }
|
||||
glcr::String& mutable_path() { return path_; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
|
||||
private:
|
||||
|
|
@ -38,17 +41,24 @@ class OpenFileResponse {
|
|||
OpenFileResponse() {}
|
||||
// Delete copy and move until implemented.
|
||||
OpenFileResponse(const OpenFileResponse&) = delete;
|
||||
OpenFileResponse(OpenFileResponse&&) = delete;
|
||||
OpenFileResponse(OpenFileResponse&&) = default;
|
||||
OpenFileResponse& operator=(OpenFileResponse&&) = default;
|
||||
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message);
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
|
||||
const glcr::String& path() const { return path_; }
|
||||
glcr::String& mutable_path() { return path_; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
|
||||
const uint64_t& size() const { return size_; }
|
||||
uint64_t& mutable_size() { return size_; }
|
||||
void set_size(const uint64_t& value) { size_ = value; }
|
||||
|
||||
const z_cap_t& memory() const { return memory_; }
|
||||
z_cap_t& mutable_memory() { return memory_; }
|
||||
void set_memory(const z_cap_t& value) { memory_ = value; }
|
||||
|
||||
private:
|
||||
|
|
@ -66,13 +76,16 @@ class GetDirectoryRequest {
|
|||
GetDirectoryRequest() {}
|
||||
// Delete copy and move until implemented.
|
||||
GetDirectoryRequest(const GetDirectoryRequest&) = delete;
|
||||
GetDirectoryRequest(GetDirectoryRequest&&) = delete;
|
||||
GetDirectoryRequest(GetDirectoryRequest&&) = default;
|
||||
GetDirectoryRequest& operator=(GetDirectoryRequest&&) = default;
|
||||
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message);
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
|
||||
const glcr::String& path() const { return path_; }
|
||||
glcr::String& mutable_path() { return path_; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
|
||||
private:
|
||||
|
|
@ -88,13 +101,16 @@ class Directory {
|
|||
Directory() {}
|
||||
// Delete copy and move until implemented.
|
||||
Directory(const Directory&) = delete;
|
||||
Directory(Directory&&) = delete;
|
||||
Directory(Directory&&) = default;
|
||||
Directory& operator=(Directory&&) = default;
|
||||
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message);
|
||||
[[nodiscard]] glcr::Status ParseFromBytes(const yunq::MessageView& message, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
|
||||
const glcr::String& filenames() const { return filenames_; }
|
||||
glcr::String& mutable_filenames() { return filenames_; }
|
||||
void set_filenames(const glcr::String& value) { filenames_ = value; }
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue