From 063224c69d564d6e10dd4febf25caa9f59fccfda Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 3 Sep 2023 20:11:35 -0600 Subject: Fixed AIFC Extraction --- lib/binarytools/BinaryWriter.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/binarytools/BinaryWriter.cpp') diff --git a/lib/binarytools/BinaryWriter.cpp b/lib/binarytools/BinaryWriter.cpp index 362824f..6e0140f 100644 --- a/lib/binarytools/BinaryWriter.cpp +++ b/lib/binarytools/BinaryWriter.cpp @@ -132,10 +132,11 @@ void LUS::BinaryWriter::Write(double value) { mStream->Write((char*)&value, sizeof(double)); } -void LUS::BinaryWriter::Write(const std::string& str) { - int strLen = str.size(); - Write(strLen); - +void LUS::BinaryWriter::Write(const std::string& str, bool writeLength) { + if(writeLength){ + int strLen = str.size(); + Write(strLen); + } for (char c : str) { mStream->WriteByte(c); } @@ -145,6 +146,10 @@ void LUS::BinaryWriter::Write(char* srcBuffer, size_t length) { mStream->Write(srcBuffer, length); } +void LUS::BinaryWriter::WriteByte(char value) { + mStream->WriteByte(value); +} + std::vector LUS::BinaryWriter::ToVector() { return mStream->ToVector(); } -- cgit v1.2.3