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.cpp127
1 files changed, 0 insertions, 127 deletions
diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp
index 2762497e5c..91ca6dad7c 100644
--- a/core/fxcrt/fx_basic_buffer.cpp
+++ b/core/fxcrt/fx_basic_buffer.cpp
@@ -182,133 +182,6 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) {
return *this;
}
-#ifdef PDF_ENABLE_XFA
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) {
- if (m_pStream) {
- m_pStream->WriteBlock(&i, 1);
- } else {
- m_SavingBuf.AppendByte(i);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(int i) {
- if (m_pStream) {
- m_pStream->WriteBlock(&i, sizeof(int));
- } else {
- m_SavingBuf.AppendBlock(&i, sizeof(int));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint32_t i) {
- if (m_pStream) {
- m_pStream->WriteBlock(&i, sizeof(uint32_t));
- } else {
- m_SavingBuf.AppendBlock(&i, sizeof(uint32_t));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(FX_FLOAT f) {
- if (m_pStream) {
- m_pStream->WriteBlock(&f, sizeof(FX_FLOAT));
- } else {
- m_SavingBuf.AppendBlock(&f, sizeof(FX_FLOAT));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(const CFX_ByteStringC& bstr) {
- int len = bstr.GetLength();
- if (m_pStream) {
- m_pStream->WriteBlock(&len, sizeof(int));
- m_pStream->WriteBlock(bstr.raw_str(), len);
- } else {
- m_SavingBuf.AppendBlock(&len, sizeof(int));
- m_SavingBuf.AppendBlock(bstr.raw_str(), len);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(const FX_WCHAR* wstr) {
- FX_STRSIZE len = FXSYS_wcslen(wstr);
- if (m_pStream) {
- m_pStream->WriteBlock(&len, sizeof(int));
- m_pStream->WriteBlock(wstr, len);
- } else {
- m_SavingBuf.AppendBlock(&len, sizeof(int));
- m_SavingBuf.AppendBlock(wstr, len);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(const CFX_WideString& wstr) {
- CFX_ByteString encoded = wstr.UTF16LE_Encode();
- return operator<<(encoded.AsStringC());
-}
-void CFX_ArchiveSaver::Write(const void* pData, FX_STRSIZE dwSize) {
- if (m_pStream) {
- m_pStream->WriteBlock(pData, dwSize);
- } else {
- m_SavingBuf.AppendBlock(pData, dwSize);
- }
-}
-CFX_ArchiveLoader::CFX_ArchiveLoader(const uint8_t* pData, uint32_t dwSize) {
- m_pLoadingBuf = pData;
- m_LoadingPos = 0;
- m_LoadingSize = dwSize;
-}
-FX_BOOL CFX_ArchiveLoader::IsEOF() {
- return m_LoadingPos >= m_LoadingSize;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(uint8_t& i) {
- if (m_LoadingPos >= m_LoadingSize) {
- return *this;
- }
- i = m_pLoadingBuf[m_LoadingPos++];
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(int& i) {
- Read(&i, sizeof(int));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(uint32_t& i) {
- Read(&i, sizeof(uint32_t));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(FX_FLOAT& i) {
- Read(&i, sizeof(FX_FLOAT));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_ByteString& str) {
- if (m_LoadingPos + 4 > m_LoadingSize) {
- return *this;
- }
- int len;
- operator>>(len);
- str.clear();
- if (len <= 0 || m_LoadingPos + len > m_LoadingSize) {
- return *this;
- }
- FX_CHAR* buffer = str.GetBuffer(len);
- FXSYS_memcpy(buffer, m_pLoadingBuf + m_LoadingPos, len);
- str.ReleaseBuffer(len);
- m_LoadingPos += len;
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_WideString& str) {
- CFX_ByteString encoded;
- operator>>(encoded);
- str = CFX_WideString::FromUTF16LE(
- reinterpret_cast<const unsigned short*>(encoded.c_str()),
- encoded.GetLength() / sizeof(unsigned short));
- return *this;
-}
-FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, uint32_t dwSize) {
- if (m_LoadingPos + dwSize > m_LoadingSize) {
- return FALSE;
- }
- FXSYS_memcpy(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
- m_LoadingPos += dwSize;
- return TRUE;
-}
-#endif // PDF_ENABLE_XFA
-
void CFX_BitStream::Init(const uint8_t* pData, uint32_t dwSize) {
m_pData = pData;
m_BitSize = dwSize * 8;