1 // Copyright 2017 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCRT_CSS_CFX_CSSTEXTBUF_H_ 8 #define CORE_FXCRT_CSS_CFX_CSSTEXTBUF_H_ 9 10 #include "core/fxcrt/fx_system.h" 11 12 class CFX_CSSTextBuf { 13 public: 14 CFX_CSSTextBuf(); 15 ~CFX_CSSTextBuf(); 16 17 void InitWithSize(int32_t iAllocSize); 18 void AppendChar(wchar_t wch); 19 Clear()20 void Clear() { m_iDatLen = 0; } 21 22 int32_t TrimEnd(); 23 GetLength()24 int32_t GetLength() const { return m_iDatLen; } GetBuffer()25 const wchar_t* GetBuffer() const { return m_pBuffer; } 26 27 protected: 28 void ExpandBuf(int32_t iDesiredSize); 29 30 wchar_t* m_pBuffer; 31 int32_t m_iBufLen; 32 int32_t m_iDatLen; 33 }; 34 35 #endif // CORE_FXCRT_CSS_CFX_CSSTEXTBUF_H_ 36