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_FXCRT_FX_BASIC_H_ | 7 #ifndef CORE_FXCRT_FX_BASIC_H_ |
8 #define CORE_FXCRT_FX_BASIC_H_ | 8 #define CORE_FXCRT_FX_BASIC_H_ |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 void AppendByte(uint8_t byte) { | 35 void AppendByte(uint8_t byte) { |
36 ExpandBuf(1); | 36 ExpandBuf(1); |
37 m_pBuffer.get()[m_DataSize++] = byte; | 37 m_pBuffer.get()[m_DataSize++] = byte; |
38 } | 38 } |
39 | 39 |
40 void InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size); | 40 void InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size); |
41 void Delete(int start_index, int count); | 41 void Delete(int start_index, int count); |
42 | 42 |
43 // Releases ownership of |m_pBuffer| and returns it. | 43 // Releases ownership of |m_pBuffer| and returns it. |
44 uint8_t* DetachBuffer(); | 44 std::unique_ptr<uint8_t, FxFreeDeleter> DetachBuffer(); |
45 | 45 |
46 protected: | 46 protected: |
47 void ExpandBuf(FX_STRSIZE size); | 47 void ExpandBuf(FX_STRSIZE size); |
48 | 48 |
49 FX_STRSIZE m_AllocStep; | 49 FX_STRSIZE m_AllocStep; |
50 FX_STRSIZE m_AllocSize; | 50 FX_STRSIZE m_AllocSize; |
51 FX_STRSIZE m_DataSize; | 51 FX_STRSIZE m_DataSize; |
52 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; | 52 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; |
53 }; | 53 }; |
54 | 54 |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 FX_FLOAT e; | 739 FX_FLOAT e; |
740 FX_FLOAT f; | 740 FX_FLOAT f; |
741 FX_FLOAT g; | 741 FX_FLOAT g; |
742 FX_FLOAT h; | 742 FX_FLOAT h; |
743 FX_FLOAT i; | 743 FX_FLOAT i; |
744 }; | 744 }; |
745 | 745 |
746 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits); | 746 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits); |
747 | 747 |
748 #endif // CORE_FXCRT_FX_BASIC_H_ | 748 #endif // CORE_FXCRT_FX_BASIC_H_ |
OLD | NEW |