TrueReality  v0.1.1912
Object.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 
25 #include <trUtil/Export.h>
26 
27 #include <trUtil/JSON/Base.h>
28 #include <trUtil/JSON/Value.h>
29 
30 #include <string>
31 
37 namespace trUtil::JSON
38 {
47  {
48  public:
49 
55  Object();
56 
64  Object(const Value &Object);
65 
71  ~Object();
72 
80  const Value::Members GetMemberNames() const;
81 
82  /*
83  * Adds a comment to the internal value
84  */
85 
93  void SetComment(const std::string& comment);
94 
102  bool HasComment() const;
103 
111  std::string GetComment() const;
112 
118  void Clear() override;
119 
127  virtual Value& GetJSONRoot() override;
128 
134  virtual void PrintJSONRoot() override;
135 
145  virtual bool KeyPresent(const std::string &key) const override;
146 
156  virtual bool IsNull(const std::string &key) const override;
157 
165  virtual void SetNull(const std::string &key) override;
166 
176  virtual bool IsBool(const std::string &key) const override;
177 
187  virtual bool GetBool(const std::string &key) const override;
188 
197  virtual void SetBool(const std::string &key, const bool &value) override;
198 
208  virtual bool IsTrue(const std::string &key) const override;
209 
219  virtual bool IsFalse(const std::string &key) const override;
220 
230  virtual bool IsNumber(const std::string &key) const override;
231 
241  virtual bool IsInt(const std::string &key) const override;
242 
252  virtual int GetInt(const std::string &key) const override;
253 
262  virtual void SetInt(const std::string &key, const int &value) override;
263 
273  virtual bool IsDouble(const std::string &key) const override;
274 
284  virtual double GetDouble(const std::string &key) const override;
285 
294  virtual void SetDouble(const std::string &key, const double &value) override;
295 
305  virtual bool IsUInt(const std::string &key) const override;
306 
316  virtual unsigned int GetUInt(const std::string &key) const override;
317 
326  virtual void SetUInt(const std::string &key, const unsigned int &value) override;
327 
337  virtual bool IsInt64(const std::string &key) const override;
338 
348  virtual Int64 GetInt64(const std::string &key) const override;
349 
358  virtual void SetInt64(const std::string &key, const Int64 &value) override;
359 
369  virtual bool IsUInt64(const std::string &key) const override;
370 
380  virtual UInt64 GetUInt64(const std::string &key) const override;
381 
390  virtual void SetUInt64(const std::string &key, const UInt64 &value) override;
391 
401  virtual bool IsFloat(const std::string &key) const override;
402 
412  virtual float GetFloat(const std::string &key) const override;
413 
422  virtual void SetFloat(const std::string &key, const float &value) override;
423 
433  virtual bool IsString(const std::string &key) const override;
434 
444  virtual const std::string GetString(const std::string &key) const override;
445 
454  virtual void SetString(const std::string &key, const std::string &value) override;
455 
465  virtual bool IsArray(const std::string &key) const override;
466 
476  virtual Array GetArray(const std::string &key) const override;
477 
486  virtual void SetArray(const std::string &key, Array &value) override;
487 
497  virtual bool IsObject(const std::string &key) const override;
498 
508  virtual Object GetObject(const std::string &key) const override;
509 
518  virtual void SetObject(const std::string &key, Object &value) override;
519 
520  private:
523  };
524 }
array value (ordered list)
Definition: Value.h:98
A JSON array.
Definition: Array.h:46
Represents a JSON value.
Definition: Value.h:139
The Base class for all the JSON classes.
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
std::vector< std::string > Members
The members.
Definition: Value.h:144