TrueReality  v0.1.1912
ArrayBase.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include <trUtil/Export.h>
25 
26 #include <trUtil/JSON/Value.h>
27 
28 #include <osg/Referenced>
29 
30 #include <stdint.h>
31 #include <string>
32 
38 namespace trUtil::JSON
39 {
45  class Object;
46 
52  class Array;
53 
61  class TR_UTIL_EXPORT ArrayBase : osg::Referenced
62  {
63 
64  public:
65 
71  virtual void Clear() = 0;
72 
80  virtual Value& GetJSONRoot() = 0;
81 
87  virtual void PrintJSONRoot() = 0;
88 
98  virtual bool IsNull(int &index) const = 0;
99 
105  virtual void AddNull() = 0;
106 
116  virtual bool IsBool(int &index) const = 0;
117 
127  virtual bool GetBool(int &index) const = 0;
128 
136  virtual void AddBool(const bool &value) = 0;
137 
147  virtual bool IsTrue(int &index) const = 0;
148 
158  virtual bool IsFalse(int &index) const = 0;
159 
169  virtual bool IsNumber(int &index) const = 0;
170 
180  virtual bool IsInt(int &index) const = 0;
181 
191  virtual int GetInt(int &index) const = 0;
192 
200  virtual void AddInt(const int &value) = 0;
201 
211  virtual bool IsDouble(int &index) const = 0;
212 
222  virtual double GetDouble(int &index) const = 0;
223 
231  virtual void AddDouble(const double &value) = 0;
232 
242  virtual bool IsUInt(int &index) const = 0;
243 
253  virtual unsigned int GetUInt(int &index) const = 0;
254 
262  virtual void AddUInt(const unsigned int &value) = 0;
263 
273  virtual bool IsInt64(int &index) const = 0;
274 
284  virtual Int64 GetInt64(int &index) const = 0;
285 
293  virtual void AddInt64(const Int64 &value) = 0;
294 
304  virtual bool IsUInt64(int &index) const = 0;
305 
315  virtual UInt64 GetUInt64(int &index) const = 0;
316 
324  virtual void AddUInt64(const UInt64 &value) = 0;
325 
335  virtual bool IsFloat(int &index) const = 0;
336 
346  virtual float GetFloat(int &index) const = 0;
347 
355  virtual void AddFloat(const float &value) = 0;
356 
366  virtual bool IsString(int &index) const = 0;
367 
377  virtual const std::string GetString(int &index) const = 0;
378 
386  virtual void AddString(const std::string &value) = 0;
387 
397  virtual bool IsArray(int &index) const = 0;
398 
408  virtual Array GetArray(int &index) const = 0;
409 
417  virtual void AddArray(Array &Array) = 0;
418 
428  virtual bool IsObject(int &index) const = 0;
429 
439  virtual Object GetObject(int &index) const = 0;
440 
448  virtual void AddObject(Object &Object) = 0;
449  };
450 }
A JSON array.
Definition: Array.h:46
Represents a JSON value.
Definition: Value.h:139
int64_t Int64
The fourth int 6.
Definition: Value.h:72
Forward declaration.
Definition: Object.h:46
A class that represents date time utility.
uint64_t UInt64
The fourth u int 6.
Definition: Value.h:74
An array base.
Definition: ArrayBase.h:61