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_FGAS_CRT_FGAS_UTILS_H_ | 7 #ifndef XFA_FGAS_CRT_FGAS_UTILS_H_ |
8 #define XFA_FGAS_CRT_FGAS_UTILS_H_ | 8 #define XFA_FGAS_CRT_FGAS_UTILS_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_coordinates.h" | 10 #include "core/fxcrt/include/fx_coordinates.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 int32_t iCount = -1) { | 73 int32_t iCount = -1) { |
74 return CFX_BaseArray::Copy(src, iStart, iCount); | 74 return CFX_BaseArray::Copy(src, iStart, iCount); |
75 } | 75 } |
76 int32_t RemoveLast(int32_t iCount = -1) { | 76 int32_t RemoveLast(int32_t iCount = -1) { |
77 return CFX_BaseArray::RemoveLast(iCount); | 77 return CFX_BaseArray::RemoveLast(iCount); |
78 } | 78 } |
79 void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { | 79 void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { |
80 CFX_BaseArray::RemoveAll(bLeaveMemory); | 80 CFX_BaseArray::RemoveAll(bLeaveMemory); |
81 } | 81 } |
82 }; | 82 }; |
83 typedef CFX_BaseArrayTemplate<uint32_t> CFDE_DWordArray; | |
84 | 83 |
85 template <class baseType> | 84 template <class baseType> |
86 class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { | 85 class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { |
87 public: | 86 public: |
88 CFX_ObjectBaseArrayTemplate(int32_t iGrowSize = 100) | 87 CFX_ObjectBaseArrayTemplate(int32_t iGrowSize = 100) |
89 : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} | 88 : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} |
90 ~CFX_ObjectBaseArrayTemplate() { RemoveAll(FALSE); } | 89 ~CFX_ObjectBaseArrayTemplate() { RemoveAll(FALSE); } |
91 int32_t GetSize() const { return CFX_BaseArray::GetSize(); } | 90 int32_t GetSize() const { return CFX_BaseArray::GetSize(); } |
92 int32_t GetBlockSize() const { return CFX_BaseArray::GetBlockSize(); } | 91 int32_t GetBlockSize() const { return CFX_BaseArray::GetBlockSize(); } |
93 int32_t Add(const baseType& element) { | 92 int32_t Add(const baseType& element) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 int32_t iCount = -1) { | 267 int32_t iCount = -1) { |
269 return CFX_BaseMassArray::Copy(src, iStart, iCount); | 268 return CFX_BaseMassArray::Copy(src, iStart, iCount); |
270 } | 269 } |
271 int32_t RemoveLast(int32_t iCount = -1) { | 270 int32_t RemoveLast(int32_t iCount = -1) { |
272 return CFX_BaseMassArray::RemoveLast(iCount); | 271 return CFX_BaseMassArray::RemoveLast(iCount); |
273 } | 272 } |
274 void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { | 273 void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { |
275 CFX_BaseMassArray::RemoveAll(bLeaveMemory); | 274 CFX_BaseMassArray::RemoveAll(bLeaveMemory); |
276 } | 275 } |
277 }; | 276 }; |
278 typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray; | |
279 | 277 |
280 template <class baseType> | 278 template <class baseType> |
281 class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { | 279 class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { |
282 public: | 280 public: |
283 CFX_ObjectMassArrayTemplate(int32_t iChunkSize = 100) | 281 CFX_ObjectMassArrayTemplate(int32_t iChunkSize = 100) |
284 : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} | 282 : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} |
285 ~CFX_ObjectMassArrayTemplate() { RemoveAll(FALSE); } | 283 ~CFX_ObjectMassArrayTemplate() { RemoveAll(FALSE); } |
286 int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); } | 284 int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); } |
287 int32_t Add(const baseType& element) { | 285 int32_t Add(const baseType& element) { |
288 int32_t index = CFX_BaseMassArray::GetSize(); | 286 int32_t index = CFX_BaseMassArray::GetSize(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 478 } |
481 RemoveAll(TRUE); | 479 RemoveAll(TRUE); |
482 for (int32_t i = iStart; i < iEnd; i++) { | 480 for (int32_t i = iStart; i < iEnd; i++) { |
483 Push(*src.GetAt(i)); | 481 Push(*src.GetAt(i)); |
484 } | 482 } |
485 return CFX_BaseStack::GetSize(); | 483 return CFX_BaseStack::GetSize(); |
486 } | 484 } |
487 }; | 485 }; |
488 | 486 |
489 #endif // XFA_FGAS_CRT_FGAS_UTILS_H_ | 487 #endif // XFA_FGAS_CRT_FGAS_UTILS_H_ |
OLD | NEW |