summaryrefslogtreecommitdiff
path: root/lib/binarytools/BinaryWriter.cpp
diff options
context:
space:
mode:
authorLywx <kiritodev01@gmail.com>2023-09-16 04:01:24 -0600
committerGitHub <noreply@github.com>2023-09-16 04:01:24 -0600
commitae8487a4adc5d6d33c47d41e3a40d3c67ddb1e45 (patch)
treee03627371fc7423c684631ed7eee68d697709e0f /lib/binarytools/BinaryWriter.cpp
parentf5cbd0056d601e4adaf5ed9006192dd510226ee3 (diff)
parent98b6d598324fdcb499a2cc4d37a7a6fcd19e8ead (diff)
Merge pull request #1 from KiritoDv/feature/audio
Implemented full audio extraction
Diffstat (limited to 'lib/binarytools/BinaryWriter.cpp')
-rw-r--r--lib/binarytools/BinaryWriter.cpp13
1 files changed, 9 insertions, 4 deletions
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<char> LUS::BinaryWriter::ToVector() {
return mStream->ToVector();
}