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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 }; | 1064 }; |
1065 template <typename T1, typename T2> | 1065 template <typename T1, typename T2> |
1066 class CFX_ListArrayTemplate { | 1066 class CFX_ListArrayTemplate { |
1067 public: | 1067 public: |
1068 void Clear() { m_Data.Clear(); } | 1068 void Clear() { m_Data.Clear(); } |
1069 | 1069 |
1070 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } | 1070 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } |
1071 | 1071 |
1072 T2& operator[](int32_t nIndex) { | 1072 T2& operator[](int32_t nIndex) { |
1073 uint8_t* data = m_Data.GetAt(nIndex); | 1073 uint8_t* data = m_Data.GetAt(nIndex); |
1074 FXSYS_assert(data != NULL); | 1074 FXSYS_assert(data); |
1075 return (T2&)(*(volatile T2*)data); | 1075 return (T2&)(*(volatile T2*)data); |
1076 } | 1076 } |
1077 | 1077 |
1078 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } | 1078 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } |
1079 | 1079 |
1080 protected: | 1080 protected: |
1081 T1 m_Data; | 1081 T1 m_Data; |
1082 }; | 1082 }; |
1083 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, | 1083 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, |
1084 FX_FILESIZE> CFX_FileSizeListArray; | 1084 FX_FILESIZE> CFX_FileSizeListArray; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 FX_FLOAT c; | 1141 FX_FLOAT c; |
1142 FX_FLOAT d; | 1142 FX_FLOAT d; |
1143 FX_FLOAT e; | 1143 FX_FLOAT e; |
1144 FX_FLOAT f; | 1144 FX_FLOAT f; |
1145 FX_FLOAT g; | 1145 FX_FLOAT g; |
1146 FX_FLOAT h; | 1146 FX_FLOAT h; |
1147 FX_FLOAT i; | 1147 FX_FLOAT i; |
1148 }; | 1148 }; |
1149 | 1149 |
1150 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 1150 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
OLD | NEW |