blob: e7e0bded57b579c23ed4faab2a305d3477e3191a [file] [log] [blame]
Tom Sepez41d04e12018-10-30 22:07:36 +00001// 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
13class CFX_KeyValue;
14
15class CFX_GlobalArray {
16 public:
17 CFX_GlobalArray();
Tom Sepez436c9f12018-11-05 18:20:23 +000018 CFX_GlobalArray(const CFX_GlobalArray& that) = delete;
19 CFX_GlobalArray(CFX_GlobalArray&& that);
Tom Sepez41d04e12018-10-30 22:07:36 +000020 ~CFX_GlobalArray();
21
Tom Sepez436c9f12018-11-05 18:20:23 +000022 CFX_GlobalArray& operator=(const CFX_GlobalArray& array) = delete;
23 CFX_GlobalArray& operator=(CFX_GlobalArray&& array);
Tom Sepez41d04e12018-10-30 22:07:36 +000024
25 void Add(std::unique_ptr<CFX_KeyValue> pKeyValue);
Tom Sepez9964a4a2018-10-30 23:12:31 +000026 size_t Count() const;
Tom Sepez41d04e12018-10-30 22:07:36 +000027 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_