• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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_KEYVALUE_H_
8 #define FXJS_CFX_KEYVALUE_H_
9 
10 #include <memory>
11 #include <vector>
12 
13 #include "core/fxcrt/fx_string.h"
14 
15 class CFX_KeyValue;
16 
17 class CFX_Value {
18  public:
19   enum class DataType : uint8_t {
20     NUMBER = 0,
21     BOOLEAN,
22     STRING,
23     OBJECT,
24     NULLOBJ
25   };
26 
27   CFX_Value();
28   ~CFX_Value();
29 
30   DataType nType = DataType::NULLOBJ;
31   bool bData;
32   double dData;
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