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 22 matching lines...) Expand all Loading... |
33 } | 33 } |
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 // Takes ownership of |pBuf|. | |
44 void AttachData(uint8_t* pBuf, FX_STRSIZE size); | |
45 | |
46 // Releases ownership of |m_pBuffer| and returns it. | 43 // Releases ownership of |m_pBuffer| and returns it. |
47 uint8_t* DetachBuffer(); | 44 uint8_t* DetachBuffer(); |
48 | 45 |
49 protected: | 46 protected: |
50 void ExpandBuf(FX_STRSIZE size); | 47 void ExpandBuf(FX_STRSIZE size); |
51 | 48 |
52 FX_STRSIZE m_AllocStep; | 49 FX_STRSIZE m_AllocStep; |
53 FX_STRSIZE m_AllocSize; | 50 FX_STRSIZE m_AllocSize; |
54 FX_STRSIZE m_DataSize; | 51 FX_STRSIZE m_DataSize; |
55 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; | 52 std::unique_ptr<uint8_t, FxFreeDeleter> m_pBuffer; |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 FX_FLOAT e; | 739 FX_FLOAT e; |
743 FX_FLOAT f; | 740 FX_FLOAT f; |
744 FX_FLOAT g; | 741 FX_FLOAT g; |
745 FX_FLOAT h; | 742 FX_FLOAT h; |
746 FX_FLOAT i; | 743 FX_FLOAT i; |
747 }; | 744 }; |
748 | 745 |
749 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits); | 746 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits); |
750 | 747 |
751 #endif // CORE_FXCRT_FX_BASIC_H_ | 748 #endif // CORE_FXCRT_FX_BASIC_H_ |
OLD | NEW |