OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FDE_CFX_WORDBREAK_H_ | 7 #ifndef XFA_FDE_CFX_WORDBREAK_H_ |
8 #define XFA_FDE_CFX_WORDBREAK_H_ | 8 #define XFA_FDE_CFX_WORDBREAK_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/fx_string.h" | 12 #include "core/fxcrt/fx_string.h" |
13 #include "core/fxcrt/fx_system.h" | 13 #include "core/fxcrt/fx_system.h" |
14 | 14 |
15 class IFX_CharIter; | 15 class IFX_CharIter; |
16 | 16 |
17 class CFX_WordBreak { | 17 class CFX_WordBreak { |
18 public: | 18 public: |
19 CFX_WordBreak(); | 19 CFX_WordBreak(); |
20 ~CFX_WordBreak(); | 20 ~CFX_WordBreak(); |
21 | 21 |
22 void Attach(IFX_CharIter* pIter); | 22 void Attach(IFX_CharIter* pIter); |
23 void Attach(const CFX_WideString& wsText); | 23 void Attach(const CFX_WideString& wsText); |
24 FX_BOOL Next(FX_BOOL bPrev); | 24 bool Next(bool bPrev); |
25 void SetAt(int32_t nIndex); | 25 void SetAt(int32_t nIndex); |
26 int32_t GetWordPos() const; | 26 int32_t GetWordPos() const; |
27 int32_t GetWordLength() const; | 27 int32_t GetWordLength() const; |
28 void GetWord(CFX_WideString& wsWord) const; | 28 void GetWord(CFX_WideString& wsWord) const; |
29 FX_BOOL IsEOF(FX_BOOL bTail) const; | 29 bool IsEOF(bool bTail) const; |
30 | 30 |
31 protected: | 31 protected: |
32 FX_BOOL FindNextBreakPos(IFX_CharIter* pIter, | 32 bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev, bool bFromNext = true); |
33 FX_BOOL bPrev, | |
34 FX_BOOL bFromNext = TRUE); | |
35 | 33 |
36 private: | 34 private: |
37 std::unique_ptr<IFX_CharIter> m_pPreIter; | 35 std::unique_ptr<IFX_CharIter> m_pPreIter; |
38 std::unique_ptr<IFX_CharIter> m_pCurIter; | 36 std::unique_ptr<IFX_CharIter> m_pCurIter; |
39 }; | 37 }; |
40 | 38 |
41 #endif // XFA_FDE_CFX_WORDBREAK_H_ | 39 #endif // XFA_FDE_CFX_WORDBREAK_H_ |
OLD | NEW |