| 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 _FX_BASIC_H_ | 7 #ifndef _FX_BASIC_H_ |
| 8 #define _FX_BASIC_H_ | 8 #define _FX_BASIC_H_ |
| 9 | 9 |
| 10 #include "fx_memory.h" | 10 #include "fx_memory.h" |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 766 } |
| 767 } | 767 } |
| 768 operator DataType*() | 768 operator DataType*() |
| 769 { | 769 { |
| 770 return m_pData ? m_pData : m_Data; | 770 return m_pData ? m_pData : m_Data; |
| 771 } | 771 } |
| 772 private: | 772 private: |
| 773 DataType m_Data[FixedSize]; | 773 DataType m_Data[FixedSize]; |
| 774 DataType* m_pData; | 774 DataType* m_pData; |
| 775 }; | 775 }; |
| 776 template <class DataType> | |
| 777 class CFX_TempBuf | |
| 778 { | |
| 779 public: | |
| 780 CFX_TempBuf(int size) | |
| 781 { | |
| 782 m_pData = FX_Alloc(DataType, size); | |
| 783 } | |
| 784 ~CFX_TempBuf() | |
| 785 { | |
| 786 if (m_pData) { | |
| 787 FX_Free(m_pData); | |
| 788 } | |
| 789 } | |
| 790 DataType& operator[](int i) | |
| 791 { | |
| 792 FXSYS_assert(m_pData != NULL); | |
| 793 return m_pData[i]; | |
| 794 } | |
| 795 operator DataType*() | |
| 796 { | |
| 797 return m_pData; | |
| 798 } | |
| 799 private: | |
| 800 DataType* m_pData; | |
| 801 }; | |
| 802 class CFX_MapPtrToPtr | 776 class CFX_MapPtrToPtr |
| 803 { | 777 { |
| 804 protected: | 778 protected: |
| 805 | 779 |
| 806 struct CAssoc { | 780 struct CAssoc { |
| 807 | 781 |
| 808 CAssoc* pNext; | 782 CAssoc* pNext; |
| 809 | 783 |
| 810 void* key; | 784 void* key; |
| 811 | 785 |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 FX_FLOAT c; | 1607 FX_FLOAT c; |
| 1634 FX_FLOAT d; | 1608 FX_FLOAT d; |
| 1635 FX_FLOAT e; | 1609 FX_FLOAT e; |
| 1636 FX_FLOAT f; | 1610 FX_FLOAT f; |
| 1637 FX_FLOAT g; | 1611 FX_FLOAT g; |
| 1638 FX_FLOAT h; | 1612 FX_FLOAT h; |
| 1639 FX_FLOAT i; | 1613 FX_FLOAT i; |
| 1640 }; | 1614 }; |
| 1641 | 1615 |
| 1642 #endif | 1616 #endif |
| OLD | NEW |