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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 }; | 1058 }; |
1059 template <typename T1, typename T2> | 1059 template <typename T1, typename T2> |
1060 class CFX_ListArrayTemplate { | 1060 class CFX_ListArrayTemplate { |
1061 public: | 1061 public: |
1062 void Clear() { m_Data.Clear(); } | 1062 void Clear() { m_Data.Clear(); } |
1063 | 1063 |
1064 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } | 1064 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } |
1065 | 1065 |
1066 T2& operator[](int32_t nIndex) { | 1066 T2& operator[](int32_t nIndex) { |
1067 uint8_t* data = m_Data.GetAt(nIndex); | 1067 uint8_t* data = m_Data.GetAt(nIndex); |
1068 FXSYS_assert(data != NULL); | 1068 FXSYS_assert(data); |
1069 return (T2&)(*(volatile T2*)data); | 1069 return (T2&)(*(volatile T2*)data); |
1070 } | 1070 } |
1071 | 1071 |
1072 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } | 1072 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } |
1073 | 1073 |
1074 protected: | 1074 protected: |
1075 T1 m_Data; | 1075 T1 m_Data; |
1076 }; | 1076 }; |
1077 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, | 1077 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, |
1078 FX_FILESIZE> CFX_FileSizeListArray; | 1078 FX_FILESIZE> CFX_FileSizeListArray; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 FX_FLOAT c; | 1135 FX_FLOAT c; |
1136 FX_FLOAT d; | 1136 FX_FLOAT d; |
1137 FX_FLOAT e; | 1137 FX_FLOAT e; |
1138 FX_FLOAT f; | 1138 FX_FLOAT f; |
1139 FX_FLOAT g; | 1139 FX_FLOAT g; |
1140 FX_FLOAT h; | 1140 FX_FLOAT h; |
1141 FX_FLOAT i; | 1141 FX_FLOAT i; |
1142 }; | 1142 }; |
1143 | 1143 |
1144 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 1144 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
OLD | NEW |