23#ifndef INCLUDED_WRITE_BUFFER
24#define INCLUDED_WRITE_BUFFER
33 void Append(
const void* data,
size_t size);
35 void Overwrite(
const void* data,
size_t size,
size_t offset);
37 std::shared_ptr<u8>
Data()
const
Definition: write_buffer.h:58
Status Append(const u8 *data, size_t size) const
add data to the align buffer, writing it out to disk if full.
Definition: write_buffer.cpp:101
PFile m_file
Definition: write_buffer.h:78
Status WriteBlock() const
Definition: write_buffer.cpp:140
size_t m_bytesUsed
Definition: write_buffer.h:81
off_t m_alignedOfs
Definition: write_buffer.h:80
UnalignedWriter(const PFile &file, off_t ofs)
Definition: write_buffer.cpp:81
std::shared_ptr< u8 > m_alignedBuf
Definition: write_buffer.h:79
~UnalignedWriter()
Definition: write_buffer.cpp:95
NONCOPYABLE(UnalignedWriter)
void Flush() const
zero-initialize any remaining space in the align buffer and write it to the file.
Definition: write_buffer.cpp:130
Definition: write_buffer.h:29
size_t m_size
Definition: write_buffer.h:53
void EnsureSufficientCapacity(size_t size)
Definition: write_buffer.cpp:41
void Reserve(size_t size)
Definition: write_buffer.cpp:62
std::shared_ptr< u8 > Data() const
Definition: write_buffer.h:37
std::shared_ptr< u8 > m_data
Definition: write_buffer.h:52
void Overwrite(const void *data, size_t size, size_t offset)
Definition: write_buffer.cpp:70
size_t Size() const
Definition: write_buffer.h:42
size_t m_capacity
Definition: write_buffer.h:50
void Append(const void *data, size_t size)
Definition: write_buffer.cpp:54
WriteBuffer()
Definition: write_buffer.cpp:35
std::shared_ptr< File > PFile
Definition: file.h:99
i64 Status
Error handling system.
Definition: status.h:173
uint8_t u8
Definition: types.h:37
__int64 off_t
Definition: wposix_types.h:91
std::shared_ptr< UnalignedWriter > PUnalignedWriter
Definition: write_buffer.h:84