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

#include <Document.hh>

+ Collaboration diagram for fedem::fson::Document:

Public Member Functions

 Document ()
 
ObjectgetRoot ()
 
Object const & getRoot () const
 
ObjectgetRootObject () noexcept
 
Object const * getRootObject () const noexcept
 
ValuegetRootValue () noexcept
 
Value const & getRootValue () const noexcept
 
void setRoot (std::unique_ptr< Value > root)
 
CommentListgetHeaderComments () noexcept
 
CommentList const & getHeaderComments () const noexcept
 
CommentListgetFooterComments () noexcept
 
CommentList const & getFooterComments () const noexcept
 
ValuefindPath (std::string const &path) noexcept
 
Value const * findPath (std::string const &path) const noexcept
 
bool containsPath (std::string const &path) const noexcept
 
ValueatPath (std::string const &path)
 
Value const & atPath (std::string const &path) const
 
ValuesetPath (std::string const &path, std::unique_ptr< Value > value)
 
bool removePath (std::string const &path) noexcept
 
bool isLocal (std::string const &path) const noexcept
 
std::optional< Object::ProvenanceprovenanceOf (std::string const &path) const
 
std::vector< Object::ProvenanceprovenanceMap () const
 
std::string getString (std::string const &path, std::string const &fallback=std::string()) const
 
long long getInteger (std::string const &path, long long fallback=0LL) const noexcept
 
double getDouble (std::string const &path, double fallback=0.0) const noexcept
 
bool getBoolean (std::string const &path, bool fallback=false) const noexcept
 

Private Member Functions

 Document (Document const &)=delete
 
 Document (Document &&)=delete
 
Documentoperator= (Document const &)=delete
 
Documentoperator= (Document &&)=delete
 

Private Attributes

CommentList header
 
std::unique_ptr< Valueroot
 
CommentList footer
 

Constructor & Destructor Documentation

◆ Document() [1/3]

fedem::fson::Document::Document ( )
inline

◆ Document() [2/3]

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

◆ Document() [3/3]

fedem::fson::Document::Document ( Document &&  )
privatedelete

Member Function Documentation

◆ getRoot() [1/2]

Object & fedem::fson::Document::getRoot ( )
inline

References root.

◆ getRoot() [2/2]

Object const & fedem::fson::Document::getRoot ( ) const
inline

References root.

◆ getRootObject() [1/2]

Object * fedem::fson::Document::getRootObject ( )
inlinenoexcept

References root.

Referenced by atPath(), getString(), provenanceMap(), provenanceOf(), fedem::fson::IncludeResolver::resolve(), and setPath().

+ Here is the caller graph for this function:

◆ getRootObject() [2/2]

Object const * fedem::fson::Document::getRootObject ( ) const
inlinenoexcept

References root.

◆ getRootValue() [1/2]

Value & fedem::fson::Document::getRootValue ( )
inlinenoexcept

References root.

Referenced by fedem::fson::FsonWriter::write().

+ Here is the caller graph for this function:

◆ getRootValue() [2/2]

Value const & fedem::fson::Document::getRootValue ( ) const
inlinenoexcept

References root.

◆ setRoot()

void fedem::fson::Document::setRoot ( std::unique_ptr< Value root)
inline

References root.

◆ getHeaderComments() [1/2]

CommentList & fedem::fson::Document::getHeaderComments ( )
inlinenoexcept

References header.

Referenced by fedem::fson::FsonWriter::write().

+ Here is the caller graph for this function:

◆ getHeaderComments() [2/2]

CommentList const & fedem::fson::Document::getHeaderComments ( ) const
inlinenoexcept

References header.

◆ getFooterComments() [1/2]

CommentList & fedem::fson::Document::getFooterComments ( )
inlinenoexcept

References footer.

Referenced by fedem::fson::FsonWriter::write().

+ Here is the caller graph for this function:

◆ getFooterComments() [2/2]

CommentList const & fedem::fson::Document::getFooterComments ( ) const
inlinenoexcept

References footer.

◆ findPath() [1/2]

Value * fedem::fson::Document::findPath ( std::string const &  path)
inlinenoexcept

◆ findPath() [2/2]

Value const * fedem::fson::Document::findPath ( std::string const &  path) const
inlinenoexcept

◆ containsPath()

bool fedem::fson::Document::containsPath ( std::string const &  path) const
inlinenoexcept

◆ atPath() [1/2]

Value & fedem::fson::Document::atPath ( std::string const &  path)
inline

References getRootObject().

+ Here is the call graph for this function:

◆ atPath() [2/2]

Value const & fedem::fson::Document::atPath ( std::string const &  path) const
inline

References getRootObject().

+ Here is the call graph for this function:

◆ setPath()

Value * fedem::fson::Document::setPath ( std::string const &  path,
std::unique_ptr< Value value 
)
inline

References getRootObject().

+ Here is the call graph for this function:

◆ removePath()

bool fedem::fson::Document::removePath ( std::string const &  path)
inlinenoexcept

◆ isLocal()

bool fedem::fson::Document::isLocal ( std::string const &  path) const
inlinenoexcept

◆ provenanceOf()

std::optional< Object::Provenance > fedem::fson::Document::provenanceOf ( std::string const &  path) const
inline

References getRootObject().

+ Here is the call graph for this function:

◆ provenanceMap()

std::vector< Object::Provenance > fedem::fson::Document::provenanceMap ( ) const
inline

References getRootObject().

+ Here is the call graph for this function:

◆ getString()

std::string fedem::fson::Document::getString ( std::string const &  path,
std::string const &  fallback = std::string( ) 
) const
inline

References getRootObject().

+ Here is the call graph for this function:

◆ getInteger()

long long fedem::fson::Document::getInteger ( std::string const &  path,
long long  fallback = 0LL 
) const
inlinenoexcept

◆ getDouble()

double fedem::fson::Document::getDouble ( std::string const &  path,
double  fallback = 0.0 
) const
inlinenoexcept

◆ getBoolean()

bool fedem::fson::Document::getBoolean ( std::string const &  path,
bool  fallback = false 
) const
inlinenoexcept

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Member Data Documentation

◆ header

CommentList fedem::fson::Document::header
private

Referenced by getHeaderComments().

◆ root

std::unique_ptr< Value > fedem::fson::Document::root
private

◆ footer

CommentList fedem::fson::Document::footer
private

Referenced by getFooterComments().


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