From 35775a82684cf9c81e3ff1aaa1a659208589becc Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sat, 8 Nov 2025 18:32:01 -0500 Subject: [PATCH] feat: add writeInt32BE method to QtStream for writing 32-bit integers in Big Endian format --- src/OverteClient.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OverteClient.cpp b/src/OverteClient.cpp index 0027242..bb44742 100644 --- a/src/OverteClient.cpp +++ b/src/OverteClient.cpp @@ -38,6 +38,9 @@ struct QtStream { void writeUInt64BE(uint64_t v) { for (int i = 7; i >= 0; --i) buf.push_back(static_cast((v >> (i * 8)) & 0xFF)); } + void writeInt32BE(int32_t v) { + writeUInt32BE(static_cast(v)); + } void writeBytes(const uint8_t* d, size_t n) { buf.insert(buf.end(), d, d + n); } void writeQByteArray(const std::vector& a) { writeUInt32BE(static_cast(a.size())); writeBytes(a.data(), a.size()); } void writeQByteArrayFromString(const std::string& s) { std::vector v(s.begin(), s.end()); writeQByteArray(v); }