summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_basic_buffer.cpp')
-rw-r--r--core/fxcrt/fx_basic_buffer.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp
index 13057f1670..36da3f4053 100644
--- a/core/fxcrt/fx_basic_buffer.cpp
+++ b/core/fxcrt/fx_basic_buffer.cpp
@@ -220,66 +220,3 @@ uint32_t CFX_BitStream::GetBits(uint32_t nBits) {
m_BitPos += nBits;
return result;
}
-
-CFX_FileBufferArchive::CFX_FileBufferArchive()
- : m_Length(0), m_pFile(nullptr) {}
-
-CFX_FileBufferArchive::~CFX_FileBufferArchive() {}
-
-void CFX_FileBufferArchive::Clear() {
- m_Length = 0;
- m_pBuffer.reset();
- m_pFile.Reset();
-}
-
-bool CFX_FileBufferArchive::Flush() {
- size_t nRemaining = m_Length;
- m_Length = 0;
- if (!m_pFile)
- return false;
- if (!m_pBuffer || !nRemaining)
- return true;
- return m_pFile->WriteBlock(m_pBuffer.get(), nRemaining);
-}
-
-int32_t CFX_FileBufferArchive::AppendBlock(const void* pBuf, size_t size) {
- if (!pBuf || size < 1)
- return 0;
-
- if (!m_pBuffer)
- m_pBuffer.reset(FX_Alloc(uint8_t, kBufSize));
-
- const uint8_t* buffer = reinterpret_cast<const uint8_t*>(pBuf);
- size_t temp_size = size;
- while (temp_size) {
- size_t buf_size = std::min(kBufSize - m_Length, temp_size);
- memcpy(m_pBuffer.get() + m_Length, buffer, buf_size);
- m_Length += buf_size;
- if (m_Length == kBufSize && !Flush())
- return -1;
-
- temp_size -= buf_size;
- buffer += buf_size;
- }
- return pdfium::base::checked_cast<int32_t>(size);
-}
-
-int32_t CFX_FileBufferArchive::AppendByte(uint8_t byte) {
- return AppendBlock(&byte, 1);
-}
-
-int32_t CFX_FileBufferArchive::AppendDWord(uint32_t i) {
- char buf[32];
- FXSYS_itoa(i, buf, 10);
- return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
-}
-
-int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) {
- return AppendBlock(lpsz.raw_str(), lpsz.GetLength());
-}
-
-void CFX_FileBufferArchive::AttachFile(
- const CFX_RetainPtr<IFX_WriteStream>& pFile) {
- ASSERT(pFile);
- m_pFile = pFile;
-}