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_CSSEXTTEXTBUF_H_ 8 #define CORE_FXCRT_CSS_CFX_CSSEXTTEXTBUF_H_ 9 10 #include "core/fxcrt/fx_system.h" 11 12 class CFX_CSSExtTextBuf { 13 public: 14 CFX_CSSExtTextBuf(); 15 ~CFX_CSSExtTextBuf(); 16 17 void AttachBuffer(const wchar_t* pBuffer, int32_t iBufLen); 18 IsEOF()19 bool IsEOF() const { return m_iDatPos >= m_iDatLen; } 20 GetChar()21 wchar_t GetChar() const { return m_pExtBuffer[m_iDatPos]; } GetNextChar()22 wchar_t GetNextChar() const { 23 return (m_iDatPos + 1 >= m_iDatLen) ? 0 : m_pExtBuffer[m_iDatPos + 1]; 24 } 25 MoveNext()26 void MoveNext() { m_iDatPos++; } 27 28 protected: 29 const wchar_t* m_pExtBuffer; 30 int32_t m_iDatLen; 31 int32_t m_iDatPos; 32 }; 33 34 #endif // CORE_FXCRT_CSS_CFX_CSSEXTTEXTBUF_H_ 35