tetengo 1.8.1
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::json::element Class Reference

An element. More...

#include <element.hpp>

Classes

struct  type_type
 The type type. More...
 

Public Types

enum class  type_name_type {
  string , number , boolean , null ,
  object , member , array
}
 The type name type. More...
 
enum class  type_category_type { primitive , structure_open , structure_close }
 The type category type. More...
 

Public Member Functions

 element (type_type type, std::string value, std::unordered_map< std::string, std::string > attributes, file_location file_location_)
 Creates an element.
 
const type_typetype () const
 Returns the type.
 
const std::string & value () const
 Returns the value.
 
const std::unordered_map< std::string, std::string > & attributes () const
 Returns the attributes.
 
const file_locationget_file_location () const
 Returns the file location.
 

Detailed Description

An element.

Member Enumeration Documentation

◆ type_category_type

The type category type.

Enumerator
primitive 

A primitive.

structure_open 

An opening structure.

structure_close 

A closing structure.

◆ type_name_type

The type name type.

Enumerator
string 

A string. primitive.

number 

A number. primitive.

boolean 

A boolean. primitive.

null 

A null. primitive.

object 

An object. structure.

member 

A member. structure.

array 

An array. structure.

Constructor & Destructor Documentation

◆ element()

tetengo::json::element::element ( type_type  type,
std::string  value,
std::unordered_map< std::string, std::string >  attributes,
file_location  file_location_ 
)

Creates an element.

Parameters
typeA type.
valueA value.
attributesAttributes.
file_location_A file location.
Exceptions
std::invalid_argumentWhen the arguments are mismatched.

Member Function Documentation

◆ attributes()

const std::unordered_map< std::string, std::string > & tetengo::json::element::attributes ( ) const

Returns the attributes.

Returns
The attributes.

◆ get_file_location()

const file_location & tetengo::json::element::get_file_location ( ) const

Returns the file location.

Returns
The file location.

◆ type()

const type_type & tetengo::json::element::type ( ) const

Returns the type.

Returns
The type.

◆ value()

const std::string & tetengo::json::element::value ( ) const

Returns the value.

Returns
The value.

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