summaryrefslogtreecommitdiff
path: root/src/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream.h')
-rw-r--r--src/stream.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/stream.h b/src/stream.h
index 0a673e89..7e92d90b 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -19,6 +19,7 @@
#include <cassert>
#include <memory>
+#include <vector>
#include "common.h"
#include "writer.h"
@@ -57,7 +58,14 @@ class Stream {
size_t size,
const char* desc = nullptr,
PrintChars = PrintChars::No);
- void MoveData(size_t dst_offset, size_t src_offset, size_t size);
+
+ template <typename T>
+ void WriteData(const std::vector<T> src,
+ const char* desc,
+ PrintChars print_chars = PrintChars::No) {
+ if (!src.empty())
+ WriteData(src.data(), src.size() * sizeof(T), desc, print_chars);
+ }
void WriteDataAt(size_t offset,
const void* src,
@@ -65,6 +73,8 @@ class Stream {
const char* desc = nullptr,
PrintChars = PrintChars::No);
+ void MoveData(size_t dst_offset, size_t src_offset, size_t size);
+
void WABT_PRINTF_FORMAT(2, 3) Writef(const char* format, ...);
// Specified as uint32_t instead of uint8_t so we can check if the value