1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2009 Emweb bv, Herent, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 #ifndef WT_JSON_ARRAY_H_
8 #define WT_JSON_ARRAY_H_
9 
10 #include <string>
11 #include <vector>
12 #include <initializer_list>
13 
14 #include <Wt/Json/Value.h>
15 
16 namespace Wt {
17   namespace Json {
18 
19 class Object;
20 class Value;
21 
22 /*! \brief A JSON array
23  *
24  * This class represents a JSON array. It is implemented as a
25  * <tt>std::vector&lt;Json::Value&gt;</tt> -- no new API to learn
26  * here!
27  *
28  * \ingroup json
29  */
30 class WT_API Array : public std::vector<Value>
31 {
32 public:
33 
34   /*! \brief Constructor.
35    */
36   Array();
37 
38   /*! \brief Copy constructor.
39    */
40   Array(const Array& other);
41 
42   /*! \brief Assignment operator.
43    */
44   Array& operator= (const Array& other);
45 
46   /*! \brief Move constructor
47    */
48   Array(Array&& other);
49 
50   /*! \brief Initializer list constructor.
51    */
52   Array(std::initializer_list<Value> list);
53 
54   /*! \brief Assignment operator.
55    */
56   Array& operator= (Array&& other);
57 
58   /*! \brief Empty array constant.
59    */
60   static Array Empty;
61 };
62 
63   }
64 }
65 
66 #endif // WT_JSON_ARRAY_H_
67