Number.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ejson/Value.hpp>
10 
11 namespace ejson {
15  class Number : public ejson::Value {
16  public:
26  Number(const ejson::Number& _obj);
31  Number(double _value=0.0);
38 
39  public:
44  void set(double _value);
49  void set(uint64_t _value);
54  void set(int64_t _value);
60  double get(double _errorValue=0.0) const;
66  uint64_t getU64(uint64_t _errorValue=0) const;
72  int64_t getI64(int64_t _errorValue=0) const;
73 
74  ejson::internal::Number::type getType() const;
75  };
76 }
77 
78 
ejson namespace containing all function for JSON interpretor
Definition: Array.hpp:12
Number(ememory::SharedPtr< ejson::internal::Value > _internalValue)
Constructor.
ejson Number interface.
Definition: Number.hpp:15
int64_t getI64(int64_t _errorValue=0) const
Get the current element Value.
Basic main object of all json elements.
Definition: Value.hpp:31
uint64_t getU64(uint64_t _errorValue=0) const
Get the current element Value.
ejson::Number & operator=(const ejson::Number &_obj)
Copy constructor.