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

#include <Array.hh>

+ Collaboration diagram for fedem::fson::Element:

Public Member Functions

 Element (std::unique_ptr< Value > value)
 
 Element (Element &&other) noexcept=default
 
Elementoperator= (Element &&other) noexcept=default
 
Element clone () const
 
ValuegetValue () noexcept
 
Value const & getValue () const noexcept
 
void setValue (std::unique_ptr< Value > value)
 
CommentListgetLeadingComments () noexcept
 
CommentList const & getLeadingComments () const noexcept
 
std::optional< Comment > & getTrailingComment () noexcept
 
std::optional< Comment > const & getTrailingComment () const noexcept
 

Private Member Functions

 Element (Element const &)=delete
 
Elementoperator= (Element const &)=delete
 

Private Attributes

CommentList leading
 
std::unique_ptr< Valuevalue
 
std::optional< Commenttrailing
 

Constructor & Destructor Documentation

◆ Element() [1/3]

fedem::fson::Element::Element ( std::unique_ptr< Value value)
explicit

◆ Element() [2/3]

fedem::fson::Element::Element ( Element &&  other)
defaultnoexcept

◆ Element() [3/3]

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

Member Function Documentation

◆ operator=() [1/2]

Element& fedem::fson::Element::operator= ( Element &&  other)
defaultnoexcept

◆ clone()

Element fedem::fson::Element::clone ( ) const

References leading, trailing, and value.

◆ getValue() [1/2]

Value & fedem::fson::Element::getValue ( )
noexcept

References value.

Referenced by fedem::fson::FsonParser::parseArrayBody(), and fedem::fson::FsonWriter::writeArray().

+ Here is the caller graph for this function:

◆ getValue() [2/2]

Value const & fedem::fson::Element::getValue ( ) const
noexcept

References value.

◆ setValue()

void fedem::fson::Element::setValue ( std::unique_ptr< Value value)

References value.

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

+ Here is the caller graph for this function:

◆ getLeadingComments() [1/2]

CommentList & fedem::fson::Element::getLeadingComments ( )
noexcept

References leading.

Referenced by fedem::fson::FsonParser::parseArrayBody(), and fedem::fson::FsonWriter::writeArray().

+ Here is the caller graph for this function:

◆ getLeadingComments() [2/2]

CommentList const & fedem::fson::Element::getLeadingComments ( ) const
noexcept

References leading.

◆ getTrailingComment() [1/2]

optional< Comment > & fedem::fson::Element::getTrailingComment ( )
noexcept

References trailing.

Referenced by fedem::fson::FsonParser::parseArrayBody(), and fedem::fson::FsonWriter::writeArray().

+ Here is the caller graph for this function:

◆ getTrailingComment() [2/2]

optional< Comment > const & fedem::fson::Element::getTrailingComment ( ) const
noexcept

References trailing.

◆ operator=() [2/2]

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

Member Data Documentation

◆ leading

CommentList fedem::fson::Element::leading
private

Referenced by clone(), and getLeadingComments().

◆ value

std::unique_ptr< Value > fedem::fson::Element::value
private

Referenced by clone(), getValue(), and setValue().

◆ trailing

std::optional< Comment > fedem::fson::Element::trailing
private

Referenced by clone(), and getTrailingComment().


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