Open Lighting Architecture
Latest Git
|
A double value.
Double Values represent numbers which are not simple integers. They can have a fractional and/or exponent. A double value takes the form: [full].[fractional]e[exponent]. e.g 23.00456e-3.
Classes | |
struct | DoubleRepresentation |
Represents a JSON double value broken down as separate components. More... | |
Public Member Functions | |
JsonDouble (double value) | |
Create a new JsonDouble. More... | |
JsonDouble (const DoubleRepresentation &rep) | |
Create a new JsonDouble from separate components. | |
bool | operator== (const JsonValue &other) const |
Equality operator. More... | |
bool | operator< (const JsonNumber &other) const |
Less than operator. | |
bool | MultipleOf (const JsonNumber &other) const |
Checks if the remainder if non-0;. | |
void | Accept (JsonValueVisitorInterface *visitor) |
The Accept method for the visitor pattern. More... | |
void | Accept (JsonValueConstVisitorInterface *visitor) const |
The Accept (const) method for the visitor pattern. More... | |
const std::string & | ToString () const |
Return the double value as a string. | |
double | Value () const |
Returns the value as a double. More... | |
JsonValue * | Clone () const |
Make a copy of this JsonValue. | |
Public Member Functions inherited from ola::web::JsonNumber | |
bool | operator<= (const JsonNumber &other) const |
Less than or equals operator. | |
bool | operator> (const JsonNumber &other) const |
Greater than operator. | |
bool | operator>= (const JsonNumber &other) const |
Greater than or equals operator. | |
Public Member Functions inherited from ola::web::JsonValue | |
virtual JsonValue * | LookupElement (const JsonPointer &pointer) |
Locate the JsonValue referred to by the JSON Pointer. | |
virtual bool | operator!= (const JsonValue &other) const |
Not-equals operator. | |
Static Public Member Functions | |
static bool | AsDouble (const DoubleRepresentation &rep, double *out) |
Convert a DoubleRepresentation to a double value. More... | |
static std::string | AsString (const DoubleRepresentation &rep) |
Convert the DoubleRepresentation to a string. More... | |
|
explicit |
Create a new JsonDouble.
value | the double to use. |
|
inlinevirtual |
The Accept method for the visitor pattern.
This can be used to traverse the Json Tree in a type-safe manner.
Implements ola::web::JsonValue.
|
inlinevirtual |
The Accept (const) method for the visitor pattern.
This can be used to traverse the Json Tree in a type-safe manner.
Implements ola::web::JsonValue.
|
static |
Convert a DoubleRepresentation to a double value.
rep | the DoubleRepresentation | |
[out] | out | The value stored as a double. |
|
static |
Convert the DoubleRepresentation to a string.
rep | the DoubleRepresentation |
|
inlinevirtual |
Equality operator.
This implements equality as defined in section 3.6 of the JSON Schema Core document.
Implements ola::web::JsonValue.
|
inline |
Returns the value as a double.
This may be incorrect if the value exceeds the storage space of the double.