[Yunq] Add repeated field parsing and serialization.
This commit is contained in:
parent
0e99189dba
commit
0dacbb87dc
7 changed files with 127 additions and 21 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <glacier/buffer/byte_buffer.h>
|
||||
#include <glacier/buffer/cap_buffer.h>
|
||||
#include <glacier/container/vector.h>
|
||||
#include <glacier/string/string.h>
|
||||
#include <ztypes.h>
|
||||
class OpenFileRequest {
|
||||
|
|
@ -15,15 +16,15 @@ class OpenFileRequest {
|
|||
void ParseFromBytes(const glcr::ByteBuffer&, uint64_t offset);
|
||||
void ParseFromBytes(const glcr::ByteBuffer&, uint64_t offset, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
glcr::String path() const { return path_; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
uint64_t options() const { return options_; }
|
||||
void set_options(const uint64_t& value) { options_ = value; }
|
||||
const glcr::Vector<uint64_t>& options() const { return options_; }
|
||||
void add_options(const uint64_t& value) { options_.PushBack(value); }
|
||||
|
||||
private:
|
||||
glcr::String path_;
|
||||
uint64_t options_;
|
||||
glcr::Vector<uint64_t> options_;
|
||||
|
||||
};
|
||||
class File {
|
||||
|
|
@ -36,11 +37,11 @@ class File {
|
|||
void ParseFromBytes(const glcr::ByteBuffer&, uint64_t offset);
|
||||
void ParseFromBytes(const glcr::ByteBuffer&, uint64_t offset, const glcr::CapBuffer&);
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
uint64_t SerializeToBytes(glcr::ByteBuffer&, uint64_t offset, glcr::CapBuffer&) const;
|
||||
glcr::String path() const { return path_; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
void set_path(const glcr::String& value) { path_ = value; }
|
||||
uint64_t attrs() const { return attrs_; }
|
||||
void set_attrs(const uint64_t& value) { attrs_ = value; }
|
||||
void set_attrs(const uint64_t& value) { attrs_ = value; }
|
||||
z_cap_t mem_cap() const { return mem_cap_; }
|
||||
void set_mem_cap(const z_cap_t& value) { mem_cap_ = value; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue