Add ioOp for TraceMsg and cleanup MetalClaw

This commit is contained in:
2018-02-15 22:22:55 -06:00
parent 2b5c34279c
commit 7f3cda0ab3
5 changed files with 35 additions and 11 deletions

View File

@@ -8,6 +8,7 @@
#pragma once
#include <ox/std/byteswap.hpp>
#include <ox/std/string.hpp>
#include <ox/std/types.hpp>
#include "err.hpp"
@@ -44,6 +45,9 @@ class MetalClawWriter {
template<typename T>
int op(const char*, T *val, size_t len);
template<size_t L>
int op(const char*, const char *val);
template<size_t L>
int op(const char*, ox::BString<L> *val);
@@ -153,7 +157,7 @@ int MetalClawWriter::op(const char*, T *val, size_t len) {
};
template<typename T>
int write(uint8_t *buff, size_t buffLen, T *val, size_t *sizeOut = nullptr) {
int writeMC(uint8_t *buff, size_t buffLen, T *val, size_t *sizeOut = nullptr) {
MetalClawWriter writer(buff, buffLen);
auto err = ioOp(&writer, val);
if (sizeOut) {