7 #ifndef PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
8 #define PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
13 #include <packager/macros/classes.h>
14 #include <packager/status.h>
51 void AppendVector(
const std::vector<uint8_t>& v);
52 void AppendString(
const std::string& s);
53 void AppendArray(
const uint8_t* buf,
size_t size);
56 void Swap(
BufferWriter* buffer) { buf_.swap(buffer->buf_); }
57 void SwapBuffer(std::vector<uint8_t>* buffer) { buf_.swap(*buffer); }
59 void Clear() { buf_.clear(); }
60 size_t Size()
const {
return buf_.size(); }
62 const uint8_t*
Buffer()
const {
return buf_.data(); }
73 void AppendInternal(T v);
75 std::vector<uint8_t> buf_;
All the methods that are virtual are virtual for mocking.