Tom Sepez | 41d04e1 | 2018-10-30 22:07:36 +0000 | [diff] [blame] | 1 | // Copyright 2017 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
| 7 | #ifndef FXJS_CFX_GLOBALARRAY_H_ |
| 8 | #define FXJS_CFX_GLOBALARRAY_H_ |
| 9 | |
| 10 | #include <memory> |
| 11 | #include <vector> |
| 12 | |
| 13 | class CFX_KeyValue; |
| 14 | |
| 15 | class CFX_GlobalArray { |
| 16 | public: |
| 17 | CFX_GlobalArray(); |
Tom Sepez | 436c9f1 | 2018-11-05 18:20:23 +0000 | [diff] [blame] | 18 | CFX_GlobalArray(const CFX_GlobalArray& that) = delete; |
| 19 | CFX_GlobalArray(CFX_GlobalArray&& that); |
Tom Sepez | 41d04e1 | 2018-10-30 22:07:36 +0000 | [diff] [blame] | 20 | ~CFX_GlobalArray(); |
| 21 | |
Tom Sepez | 436c9f1 | 2018-11-05 18:20:23 +0000 | [diff] [blame] | 22 | CFX_GlobalArray& operator=(const CFX_GlobalArray& array) = delete; |
| 23 | CFX_GlobalArray& operator=(CFX_GlobalArray&& array); |
Tom Sepez | 41d04e1 | 2018-10-30 22:07:36 +0000 | [diff] [blame] | 24 | |
| 25 | void Add(std::unique_ptr<CFX_KeyValue> pKeyValue); |
Tom Sepez | 9964a4a | 2018-10-30 23:12:31 +0000 | [diff] [blame] | 26 | size_t Count() const; |
Tom Sepez | 41d04e1 | 2018-10-30 22:07:36 +0000 | [diff] [blame] | 27 | CFX_KeyValue* GetAt(int index) const; |
| 28 | |
| 29 | private: |
| 30 | std::vector<std::unique_ptr<CFX_KeyValue>> m_Array; |
| 31 | }; |
| 32 | |
| 33 | #endif // FXJS_CFX_GLOBALARRAY_H_ |