CMSC23740 Common Code Library
Support code for CS23740 programming projects
Loading...
Searching...
No Matches
json::Number Class Referenceabstract

base class for JSON numbers More...

#include <json.hpp>

Inheritance diagram for json::Number:
Collaboration diagram for json::Number:

Public Member Functions

virtual ~Number ()
virtual std::string toString ()=0
virtual double realVal () const =0
Public Member Functions inherited from json::Value
Type type () const
 return the type of this JSON value
bool isObject () const
 return true if this value is an object
bool isArray () const
 return true if this value is an array
bool isNumber () const
 return true if this value is a number
bool isInteger () const
 return true if this value is an integer
bool isReal () const
 return true if this value is a real number
bool isString () const
 return true if this value is a string
bool isBool () const
 return true if this value is a boolean
bool isNull () const
 return true if this value is the null value
const Object * asObject () const
 dynamic cast to JSON object
const Array * asArray () const
 dynamic cast to JSON array
const Number * asNumber () const
 dynamic cast to JSON number
const Integer * asInteger () const
 dynamic cast to JSON integer
const Real * asReal () const
 dynamic cast to JSON real number
const String * asString () const
 dynamic cast to JSON string
const Bool * asBool () const
 dynamic cast to JSON boolean
virtual ~Value ()

Protected Member Functions

 Number (Type ty)
Protected Member Functions inherited from json::Value
 Value (Type ty)

Additional Inherited Members

Protected Attributes inherited from json::Value
Type _ty

Detailed Description

base class for JSON numbers

Constructor & Destructor Documentation

◆ ~Number()

virtual json::Number::~Number ( )
virtual

◆ Number()

json::Number::Number ( Type ty)
inlineexplicitprotected

Member Function Documentation

◆ realVal()

virtual double json::Number::realVal ( ) const
pure virtual

Implemented in json::Integer, and json::Real.

◆ toString()

virtual std::string json::Number::toString ( )
pure virtual

Implements json::Value.

Implemented in json::Integer, and json::Real.


The documentation for this class was generated from the following file:
  • /Users/jhr/Classes/23740/f2026/solutions/cs237-library/include/json.hpp