Chromium Code Reviews| 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 CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| 9 | 9 |
| 10 #include "fx_memory.h" | 10 #include "fx_memory.h" |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 FX_DWORD GetBits(FX_DWORD nBits); | 804 FX_DWORD GetBits(FX_DWORD nBits); |
| 805 | 805 |
| 806 void ByteAlign(); | 806 void ByteAlign(); |
| 807 | 807 |
| 808 FX_BOOL IsEOF() { return m_BitPos >= m_BitSize; } | 808 FX_BOOL IsEOF() { return m_BitPos >= m_BitSize; } |
| 809 | 809 |
| 810 void SkipBits(FX_DWORD nBits) { m_BitPos += nBits; } | 810 void SkipBits(FX_DWORD nBits) { m_BitPos += nBits; } |
| 811 | 811 |
| 812 void Rewind() { m_BitPos = 0; } | 812 void Rewind() { m_BitPos = 0; } |
| 813 | 813 |
| 814 FX_DWORD GetPos() { return m_BitPos; } | |
|
Lei Zhang
2015/12/12 01:38:12
Both methods can be const?
Oliver Chang
2015/12/12 02:37:14
good point, done.
| |
| 815 | |
| 816 FX_DWORD BitsRemaining() { | |
| 817 return m_BitSize >= m_BitPos ? m_BitSize - m_BitPos : 0; | |
| 818 } | |
| 819 | |
| 814 protected: | 820 protected: |
| 815 FX_DWORD m_BitPos; | 821 FX_DWORD m_BitPos; |
| 816 | 822 |
| 817 FX_DWORD m_BitSize; | 823 FX_DWORD m_BitSize; |
| 818 | 824 |
| 819 const uint8_t* m_pData; | 825 const uint8_t* m_pData; |
| 820 }; | 826 }; |
| 821 template <class ObjClass> | 827 template <class ObjClass> |
| 822 class CFX_CountRef { | 828 class CFX_CountRef { |
| 823 public: | 829 public: |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1135 FX_FLOAT c; | 1141 FX_FLOAT c; |
| 1136 FX_FLOAT d; | 1142 FX_FLOAT d; |
| 1137 FX_FLOAT e; | 1143 FX_FLOAT e; |
| 1138 FX_FLOAT f; | 1144 FX_FLOAT f; |
| 1139 FX_FLOAT g; | 1145 FX_FLOAT g; |
| 1140 FX_FLOAT h; | 1146 FX_FLOAT h; |
| 1141 FX_FLOAT i; | 1147 FX_FLOAT i; |
| 1142 }; | 1148 }; |
| 1143 | 1149 |
| 1144 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 1150 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| OLD | NEW |