fson  1.0.2
A comment-preserving C++ library for FSON — a human-friendly superset of JSON / JSON5
fedem::fson::Value Class Referenceabstract

#include <Value.hh>

+ Inheritance diagram for fedem::fson::Value:

Public Types

enum class  Type {
  Null , Boolean , Number , String ,
  Array , Object
}
 

Public Member Functions

virtual ~Value ()
 
virtual Type getType () const noexcept=0
 
virtual std::unique_ptr< Valueclone () const =0
 
bool isNull () const noexcept
 
bool isBoolean () const noexcept
 
bool isNumber () const noexcept
 
bool isString () const noexcept
 
bool isArray () const noexcept
 
bool isObject () const noexcept
 
virtual NullasNull () noexcept
 
virtual Null const * asNull () const noexcept
 
virtual BooleanasBoolean () noexcept
 
virtual Boolean const * asBoolean () const noexcept
 
virtual NumberasNumber () noexcept
 
virtual Number const * asNumber () const noexcept
 
virtual StringasString () noexcept
 
virtual String const * asString () const noexcept
 
virtual ArrayasArray () noexcept
 
virtual Array const * asArray () const noexcept
 
virtual ObjectasObject () noexcept
 
virtual Object const * asObject () const noexcept
 

Protected Member Functions

 Value ()=default
 

Private Member Functions

 Value (Value const &)=delete
 
 Value (Value &&)=delete
 
Valueoperator= (Value const &)=delete
 
Valueoperator= (Value &&)=delete
 

Member Enumeration Documentation

◆ Type

Enumerator
Null 
Boolean 
Number 
String 
Array 
Object 

Constructor & Destructor Documentation

◆ ~Value()

fedem::fson::Value::~Value ( )
virtualdefault

◆ Value() [1/3]

fedem::fson::Value::Value ( )
protecteddefault

◆ Value() [2/3]

fedem::fson::Value::Value ( Value const &  )
privatedelete

◆ Value() [3/3]

fedem::fson::Value::Value ( Value &&  )
privatedelete

Member Function Documentation

◆ getType()

virtual Type fedem::fson::Value::getType ( ) const
pure virtualnoexcept

Implemented in fedem::fson::String, fedem::fson::Object, fedem::fson::Number, fedem::fson::Null, fedem::fson::Boolean, and fedem::fson::Array.

Referenced by isArray(), isBoolean(), isNull(), isNumber(), isObject(), isString(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ clone()

virtual std::unique_ptr< Value > fedem::fson::Value::clone ( ) const
pure virtual

Implemented in fedem::fson::String, fedem::fson::Object, fedem::fson::Number, fedem::fson::Null, fedem::fson::Boolean, and fedem::fson::Array.

Referenced by fedem::fson::IncludeResolver::resolveObject().

+ Here is the caller graph for this function:

◆ isNull()

bool fedem::fson::Value::isNull ( ) const
inlinenoexcept

References getType(), and Null.

+ Here is the call graph for this function:

◆ isBoolean()

bool fedem::fson::Value::isBoolean ( ) const
inlinenoexcept

References Boolean, and getType().

Referenced by fedem::fson::Object::getBoolean().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNumber()

bool fedem::fson::Value::isNumber ( ) const
inlinenoexcept

References getType(), and Number.

Referenced by fedem::fson::Object::getDouble(), and fedem::fson::Object::getInteger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isString()

bool fedem::fson::Value::isString ( ) const
inlinenoexcept

References getType(), and String.

Referenced by fedem::fson::Object::getString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isArray()

bool fedem::fson::Value::isArray ( ) const
inlinenoexcept

References Array, and getType().

+ Here is the call graph for this function:

◆ isObject()

bool fedem::fson::Value::isObject ( ) const
inlinenoexcept

References getType(), and Object.

+ Here is the call graph for this function:

◆ asNull() [1/2]

Null * fedem::fson::Value::asNull ( )
virtualnoexcept

Reimplemented in fedem::fson::Null.

◆ asNull() [2/2]

Null const * fedem::fson::Value::asNull ( ) const
virtualnoexcept

Reimplemented in fedem::fson::Null.

◆ asBoolean() [1/2]

Boolean * fedem::fson::Value::asBoolean ( )
virtualnoexcept

Reimplemented in fedem::fson::Boolean.

Referenced by fedem::fson::Object::getBoolean(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ asBoolean() [2/2]

Boolean const * fedem::fson::Value::asBoolean ( ) const
virtualnoexcept

Reimplemented in fedem::fson::Boolean.

◆ asNumber() [1/2]

Number * fedem::fson::Value::asNumber ( )
virtualnoexcept

Reimplemented in fedem::fson::Number.

Referenced by fedem::fson::Object::getDouble(), fedem::fson::Object::getInteger(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ asNumber() [2/2]

Number const * fedem::fson::Value::asNumber ( ) const
virtualnoexcept

Reimplemented in fedem::fson::Number.

◆ asString() [1/2]

String * fedem::fson::Value::asString ( )
virtualnoexcept

Reimplemented in fedem::fson::String.

Referenced by fedem::fson::Object::getString(), fedem::fson::FsonParser::parseArrayBody(), fedem::fson::FsonParser::parseObjectBody(), fedem::fson::FsonWriter::writeArray(), fedem::fson::FsonWriter::writeObject(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ asString() [2/2]

String const * fedem::fson::Value::asString ( ) const
virtualnoexcept

Reimplemented in fedem::fson::String.

◆ asArray() [1/2]

Array * fedem::fson::Value::asArray ( )
virtualnoexcept

Reimplemented in fedem::fson::Array.

Referenced by fedem::fson::Object::findOwningMember(), fedem::fson::Object::findPath(), fedem::fson::Object::removePath(), fedem::fson::Object::setPath(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ asArray() [2/2]

Array const * fedem::fson::Value::asArray ( ) const
virtualnoexcept

Reimplemented in fedem::fson::Array.

◆ asObject() [1/2]

Object * fedem::fson::Value::asObject ( )
virtualnoexcept

Reimplemented in fedem::fson::Object.

Referenced by fedem::fson::Object::findOwningMember(), fedem::fson::Object::findPath(), fedem::fson::Object::removePath(), fedem::fson::IncludeResolver::resolveObject(), fedem::fson::Object::setPath(), and fedem::fson::FsonWriter::writeValue().

+ Here is the caller graph for this function:

◆ asObject() [2/2]

Object const * fedem::fson::Value::asObject ( ) const
virtualnoexcept

Reimplemented in fedem::fson::Object.

◆ operator=() [1/2]

Value& fedem::fson::Value::operator= ( Value const &  )
privatedelete

◆ operator=() [2/2]

Value& fedem::fson::Value::operator= ( Value &&  )
privatedelete

The documentation for this class was generated from the following files: