diff options
| author | Lywx <kiritodev01@gmail.com> | 2023-09-16 04:01:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-16 04:01:24 -0600 |
| commit | ae8487a4adc5d6d33c47d41e3a40d3c67ddb1e45 (patch) | |
| tree | e03627371fc7423c684631ed7eee68d697709e0f /lib/binarytools/BinaryWriter.cpp | |
| parent | f5cbd0056d601e4adaf5ed9006192dd510226ee3 (diff) | |
| parent | 98b6d598324fdcb499a2cc4d37a7a6fcd19e8ead (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.cpp | 13 |
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(); } |
