• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The PDFium Authors
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_KEYVALUE_H_
8 #define FXJS_CFX_KEYVALUE_H_
9 
10 #include <memory>
11 #include <vector>
12 
13 #include "core/fxcrt/bytestring.h"
14 
15 class CFX_KeyValue;
16 
17 class CFX_Value {
18  public:
19   enum class DataType : uint8_t {
20     kNumber = 0,
21     kBoolean,
22     kString,
23     kObject,
24     kNull
25   };
26 
27   CFX_Value();
28   ~CFX_Value();
29 
30   DataType nType = DataType::kNull;
31   bool bData = false;
32   double dData = 0.0;
33   ByteString sData;
34   std::vector<std::unique_ptr<CFX_KeyValue>> objData;
35 };
36 
37 class CFX_KeyValue : public CFX_Value {
38  public:
39   CFX_KeyValue();
40   ~CFX_KeyValue();
41 
42   ByteString sKey;
43 };
44 
45 #endif  // FXJS_CFX_KEYVALUE_H_
46