Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: core/include/fxcrt/fx_basic.h

Issue 1712353002: Remove IFX_BufferArchive. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: pFile never null. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_basic.h
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 3e30b1d1a1c224769779854de03b123ad780be75..018a91462e5ea61c57fce4bf1149eae496349fe8 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -179,46 +179,26 @@ class CFX_ArchiveLoader {
};
#endif // PDF_ENABLE_XFA
-class IFX_BufferArchive {
+class CFX_FileBufferArchive {
public:
- IFX_BufferArchive(FX_STRSIZE size);
- virtual ~IFX_BufferArchive() {}
-
- virtual void Clear();
-
- FX_BOOL Flush();
+ CFX_FileBufferArchive();
+ void Clear();
+ bool Flush();
int32_t AppendBlock(const void* pBuf, size_t size);
-
int32_t AppendByte(uint8_t byte);
-
int32_t AppendDWord(FX_DWORD i);
-
int32_t AppendString(const CFX_ByteStringC& lpsz);
- protected:
- virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0;
-
- FX_STRSIZE m_BufSize;
-
- uint8_t* m_pBuffer;
-
- FX_STRSIZE m_Length;
-};
-
-class CFX_FileBufferArchive : public IFX_BufferArchive {
- public:
- CFX_FileBufferArchive(FX_STRSIZE size = 32768);
- ~CFX_FileBufferArchive() override;
-
- void Clear() override;
- FX_BOOL AttachFile(IFX_StreamWrite* pFile, FX_BOOL bTakeover = FALSE);
+ // |pFile| must outlive the CFX_FileBufferArchive.
+ void AttachFile(IFX_StreamWrite* pFile);
private:
- FX_BOOL DoWork(const void* pBuf, size_t size) override;
+ static const size_t kBufSize = 32768;
+ size_t m_Length;
+ std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer;
IFX_StreamWrite* m_pFile;
- FX_BOOL m_bTakeover;
};
class CFX_CharMap {
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698