souffle  2.0.2-371-g6315b36
Protected Member Functions | Friends
json11::JsonValue Class Referenceabstract

#include <json11.h>

Inheritance diagram for json11::JsonValue:
Inheritance graph
Collaboration diagram for json11::JsonValue:
Collaboration graph

Protected Member Functions

virtual const Json::arrayarray_items () const
 
virtual bool bool_value () const
 
virtual void dump (std::string &out) const =0
 
virtual bool equals (const JsonValue *other) const =0
 
virtual int int_value () const
 
virtual bool less (const JsonValue *other) const =0
 
virtual long long long_value () const
 
virtual double number_value () const
 
virtual const Json::objectobject_items () const
 
virtual const Jsonoperator[] (const std::string &key) const
 
virtual const Jsonoperator[] (size_t i) const
 
virtual const std::string & string_value () const
 
virtual Json::Type type () const =0
 
virtual ~JsonValue ()=default
 

Friends

class Json
 
class JsonDouble
 
class JsonInt
 

Detailed Description

Definition at line 245 of file json11.h.

Constructor & Destructor Documentation

◆ ~JsonValue()

virtual json11::JsonValue::~JsonValue ( )
protectedvirtualdefault

Member Function Documentation

◆ array_items()

const std::vector< Json > & json11::JsonValue::array_items ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonArray.

Definition at line 582 of file json11.h.

582  {
583  return statics().empty_vector;
584 }

References json11::Statics::empty_vector, and json11::statics().

Here is the call graph for this function:

◆ bool_value()

bool json11::JsonValue::bool_value ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonBoolean.

Definition at line 576 of file json11.h.

576  {
577  return false;
578 }

◆ dump()

virtual void json11::JsonValue::dump ( std::string &  out) const
protectedpure virtual

◆ equals()

virtual bool json11::JsonValue::equals ( const JsonValue other) const
protectedpure virtual

◆ int_value()

int json11::JsonValue::int_value ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonInt, and json11::JsonDouble.

Definition at line 570 of file json11.h.

570  {
571  return 0;
572 }

◆ less()

virtual bool json11::JsonValue::less ( const JsonValue other) const
protectedpure virtual

◆ long_value()

long long json11::JsonValue::long_value ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonInt, and json11::JsonDouble.

Definition at line 573 of file json11.h.

573  {
574  return 0;
575 }

◆ number_value()

double json11::JsonValue::number_value ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonInt, and json11::JsonDouble.

Definition at line 567 of file json11.h.

567  {
568  return 0;
569 }

Referenced by json11::JsonDouble::equals(), json11::JsonInt::equals(), json11::JsonDouble::less(), and json11::JsonInt::less().

◆ object_items()

const std::map< std::string, Json > & json11::JsonValue::object_items ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonObject.

Definition at line 585 of file json11.h.

585  {
586  return statics().empty_map;
587 }

References json11::Statics::empty_map, and json11::statics().

Here is the call graph for this function:

◆ operator[]() [1/2]

const Json & json11::JsonValue::operator[] ( const std::string &  key) const
inlineprotectedvirtual

Reimplemented in json11::JsonObject.

Definition at line 591 of file json11.h.

591  {
592  return static_null();
593 }

References json11::static_null().

Here is the call graph for this function:

◆ operator[]() [2/2]

const Json & json11::JsonValue::operator[] ( size_t  i) const
inlineprotectedvirtual

Reimplemented in json11::JsonArray.

Definition at line 588 of file json11.h.

588  {
589  return static_null();
590 }

References json11::static_null().

Here is the call graph for this function:

◆ string_value()

const std::string & json11::JsonValue::string_value ( ) const
inlineprotectedvirtual

Reimplemented in json11::JsonString.

Definition at line 579 of file json11.h.

579  {
580  return statics().empty_string;
581 }

References json11::Statics::empty_string, and json11::statics().

Here is the call graph for this function:

◆ type()

virtual Json::Type json11::JsonValue::type ( ) const
protectedpure virtual

Implemented in json11::Value< tag, T >.

Friends And Related Function Documentation

◆ Json

friend class Json
friend

Definition at line 247 of file json11.h.

◆ JsonDouble

friend class JsonDouble
friend

Definition at line 249 of file json11.h.

◆ JsonInt

friend class JsonInt
friend

Definition at line 248 of file json11.h.


The documentation for this class was generated from the following file:
json11::statics
static const Statics & statics()
Definition: json11.h:504
json11::Statics::empty_vector
const std::vector< Json > empty_vector
Definition: json11.h:499
json11::static_null
static const Json & static_null()
Definition: json11.h:509
json11::Statics::empty_map
const std::map< std::string, Json > empty_map
Definition: json11.h:500
json11::Statics::empty_string
const std::string empty_string
Definition: json11.h:498