xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::json::decoder::Object Class Referencefinal

An accessor used for reading the members of a JSON object. More...

#include <json/decoder/Object.hpp>

+ Inheritance diagram for xentara::utils::json::decoder::Object:

Classes

class  Iterator
 
struct  Member
 A member of an object. More...
 

Public Member Functions

 Object ()=delete
 This type is not user-constructible.
 
internal auto begin () -> Iterator
 Returns an object that can be used to iterate over the members.
 
constexpr auto end () noexcept -> std::default_sentinel_t
 Returns an sentinel that can be used to determine if an iterator is exhausted.
 
auto document () const -> std::reference_wrapper< const Document >
 Gets the JSON document that the object belongs to.
 
auto lineNumber () const -> std::uint_least32_t
 Gets the line number in the JSON document that the object is on.
 
auto location () const -> Location
 Gets the location of the object within the JSON document.
 

Detailed Description

An accessor used for reading the members of a JSON object.

Objects of this class can be moved, but not copied.

Constructor & Destructor Documentation

◆ Object()

xentara::utils::json::decoder::Object::Object ( )
delete

This type is not user-constructible.

Member Function Documentation

◆ begin()

auto xentara::utils::json::decoder::Object::begin ( ) -> Iterator

Returns an object that can be used to iterate over the members.

Returns
An iterator that allows reading of the members
Exceptions
std::runtime_errorAn error occured reading the first member from the stream

◆ document()

auto xentara::utils::json::decoder::Object::document ( ) const -> std::reference_wrapper<const Document>

Gets the JSON document that the object belongs to.

Returns
The document

◆ end()

constexpr auto xentara::utils::json::decoder::Object::end ( ) -> std::default_sentinel_t
constexprnoexcept

Returns an sentinel that can be used to determine if an iterator is exhausted.

Returns
An sentinel for member iterators

◆ lineNumber()

auto xentara::utils::json::decoder::Object::lineNumber ( ) const -> std::uint_least32_t

Gets the line number in the JSON document that the object is on.

Returns
The line number of the curly brace that opens the object

◆ location()

auto xentara::utils::json::decoder::Object::location ( ) const -> Location

Gets the location of the object within the JSON document.

Returns
The location of the curly brace that opens the object