diff options
author | Aki <please@ignore.pl> | 2021-10-21 21:45:51 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-10-21 21:45:51 +0200 |
commit | bc99c3926208af887e4ca9d318f1d4c4744de397 (patch) | |
tree | c772a92b74e0d292d86cfe5c6cdc7f0d8f8b958d /library/src | |
parent | 648be70f7b676a618fa1753c486e8cb5f4a593f5 (diff) | |
download | hwd-bc99c3926208af887e4ca9d318f1d4c4744de397.zip hwd-bc99c3926208af887e4ca9d318f1d4c4744de397.tar.gz hwd-bc99c3926208af887e4ca9d318f1d4c4744de397.tar.bz2 |
Added memory interface to the library
Diffstat (limited to 'library/src')
-rw-r--r-- | library/src/memory.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/library/src/memory.cpp b/library/src/memory.cpp new file mode 100644 index 0000000..c3c5b2a --- /dev/null +++ b/library/src/memory.cpp @@ -0,0 +1,25 @@ +#include "hwd.h" + +#include <cstddef> +#include <vector> + +#include "client.h" + + +namespace hwd +{ +namespace memory +{ + +std::vector<char> read(std::size_t len, std::size_t off) +{ + return get_client().call("memory/read", len, off).as<std::vector<char>>(); +} + +bool write(const std::vector<char> data, std::size_t off) +{ + return get_client().call("memory/write", data, off).as<bool>(); +} + +} // namespace memory +} // namespace hwd |