diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-30 16:21:36 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-30 20:50:28 +0000 |
commit | cd07123993c2f6cfd2d08929e6ad27cab3ac74e9 (patch) | |
tree | 9a721335cc507c101557bec84d9022d7f971445a /core/fxcrt/fx_basic.h | |
parent | 5624fe39db570f5ad0fab80cf6314e95e4397698 (diff) | |
download | pdfium-cd07123993c2f6cfd2d08929e6ad27cab3ac74e9.tar.xz |
Move CFX_BinaryBuf out of fx_basic
This CL splits the CFX_BinaryBuf out of fx_basic into its own files. The
various includes have been updated.
Change-Id: I0fa616eeb4df6dd229c02dc3a0597b3dced59425
Reviewed-on: https://pdfium-review.googlesource.com/12412
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_basic.h')
-rw-r--r-- | core/fxcrt/fx_basic.h | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h index 6f676696a2..6052cc84c8 100644 --- a/core/fxcrt/fx_basic.h +++ b/core/fxcrt/fx_basic.h @@ -11,6 +11,7 @@ #include <memory> #include <vector> +#include "core/fxcrt/cfx_binarybuf.h" #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_stream.h" @@ -21,42 +22,6 @@ #define FX_IsOdd(a) ((a)&1) #endif // PDF_ENABLE_XFA -class CFX_BinaryBuf { - public: - CFX_BinaryBuf(); - explicit CFX_BinaryBuf(FX_STRSIZE size); - ~CFX_BinaryBuf(); - - uint8_t* GetBuffer() const { return m_pBuffer.get(); } - FX_STRSIZE GetSize() const { return m_DataSize; } - - void Clear(); - void EstimateSize(FX_STRSIZE size, FX_STRSIZE alloc_step = 0); - void AppendBlock(const void* pBuf, FX_STRSIZE size); - void AppendString(const CFX_ByteString& str) { - AppendBlock(str.c_str(), str.GetLength()); - } - - void AppendByte(uint8_t byte) { - ExpandBuf(1); - m_pBuffer.get()[m_DataSize++] = byte; - } - - void InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size); - void Delete(FX_STRSIZE start_index, FX_STRSIZE count); - - // Releases ownership of |m_pBuffer| and returns it. - std::unique_ptr<uint8_t, FxFreeDeleter> DetachBuffer(); - - protected: - void ExpandBuf(FX_STRSIZE size); - - FX_STRSIZE m_AllocStep; - FX_STRSIZE m_AllocSize; - FX_STRSIZE m_DataSize; - std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; -}; - class CFX_WideTextBuf : public CFX_BinaryBuf { public: void AppendChar(wchar_t wch); |