7 #ifndef PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
8 #define PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_
12 #include "packager/base/macros.h"
13 #include "packager/status.h"
50 void AppendVector(
const std::vector<uint8_t>& v);
51 void AppendString(
const std::string& s);
52 void AppendArray(
const uint8_t* buf,
size_t size);
55 void Swap(
BufferWriter* buffer) { buf_.swap(buffer->buf_); }
56 void SwapBuffer(std::vector<uint8_t>* buffer) { buf_.swap(*buffer); }
58 void Clear() { buf_.clear(); }
59 size_t Size()
const {
return buf_.size(); }
61 const uint8_t*
Buffer()
const {
return buf_.data(); }
72 void AppendInternal(T v);
74 std::vector<uint8_t> buf_;
82 #endif // PACKAGER_MEDIA_BASE_BUFFER_WRITER_H_