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

#include <Array.hh>

+ Inheritance diagram for fedem::fson::Array:
+ Collaboration diagram for fedem::fson::Array:

Public Member Functions

 Array ()=default
 
Type getType () const noexcept override
 
std::unique_ptr< Valueclone () const override
 
ArrayasArray () noexcept override
 
Array const * asArray () const noexcept override
 
std::size_t size () const noexcept
 
bool empty () const noexcept
 
Valueat (std::size_t index)
 
Value const & at (std::size_t index) const
 
ElementgetElement (std::size_t index)
 
Element const & getElement (std::size_t index) const
 
Valueappend (std::unique_ptr< Value > value)
 
Valueinsert (std::size_t index, std::unique_ptr< Value > value)
 
void erase (std::size_t index)
 
void clear () noexcept
 
CommentListgetDanglingComments () noexcept
 
CommentList const & getDanglingComments () const noexcept
 
- Public Member Functions inherited from fedem::fson::Value
virtual ~Value ()
 
bool isNull () const noexcept
 
bool isBoolean () const noexcept
 
bool isNumber () const noexcept
 
bool isString () const noexcept
 
bool isArray () const noexcept
 
bool isObject () const noexcept
 
virtual NullasNull () noexcept
 
virtual Null const * asNull () const noexcept
 
virtual BooleanasBoolean () noexcept
 
virtual Boolean const * asBoolean () const noexcept
 
virtual NumberasNumber () noexcept
 
virtual Number const * asNumber () const noexcept
 
virtual StringasString () noexcept
 
virtual String const * asString () const noexcept
 
virtual ObjectasObject () noexcept
 
virtual Object const * asObject () const noexcept
 

Private Attributes

std::vector< Elementelements
 
CommentList dangling
 

Additional Inherited Members

- Public Types inherited from fedem::fson::Value
enum class  Type {
  Null , Boolean , Number , String ,
  Array , Object
}
 
- Protected Member Functions inherited from fedem::fson::Value
 Value ()=default
 

Constructor & Destructor Documentation

◆ Array()

fedem::fson::Array::Array ( )
default

Member Function Documentation

◆ getType()

Value::Type fedem::fson::Array::getType ( ) const
inlineoverridevirtualnoexcept

Implements fedem::fson::Value.

◆ clone()

unique_ptr< Value > fedem::fson::Array::clone ( ) const
overridevirtual

Implements fedem::fson::Value.

References dangling, and elements.

◆ asArray() [1/2]

Array * fedem::fson::Array::asArray ( )
inlineoverridevirtualnoexcept

Reimplemented from fedem::fson::Value.

◆ asArray() [2/2]

Array const * fedem::fson::Array::asArray ( ) const
inlineoverridevirtualnoexcept

Reimplemented from fedem::fson::Value.

◆ size()

std::size_t fedem::fson::Array::size ( ) const
inlinenoexcept

Referenced by fedem::fson::Object::findOwningMember(), fedem::fson::Object::findPath(), fedem::fson::FsonParser::parseArrayBody(), fedem::fson::Object::removePath(), fedem::fson::Object::setPath(), and fedem::fson::FsonWriter::writeArray().

+ Here is the caller graph for this function:

◆ empty()

bool fedem::fson::Array::empty ( ) const
inlinenoexcept

◆ at() [1/2]

Value& fedem::fson::Array::at ( std::size_t  index)

Referenced by fedem::fson::Object::findOwningMember(), fedem::fson::Object::findPath(), fedem::fson::Object::removePath(), and fedem::fson::Object::setPath().

+ Here is the caller graph for this function:

◆ at() [2/2]

Value const& fedem::fson::Array::at ( std::size_t  index) const

◆ getElement() [1/2]

Element& fedem::fson::Array::getElement ( std::size_t  index)

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

+ Here is the caller graph for this function:

◆ getElement() [2/2]

Element const& fedem::fson::Array::getElement ( std::size_t  index) const

◆ append()

Value & fedem::fson::Array::append ( std::unique_ptr< Value value)

References elements.

Referenced by fedem::fson::FsonParser::parseArrayBody().

+ Here is the caller graph for this function:

◆ insert()

Value & fedem::fson::Array::insert ( std::size_t  index,
std::unique_ptr< Value value 
)

References elements, and index.

◆ erase()

void fedem::fson::Array::erase ( std::size_t  index)

References elements, and index.

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

+ Here is the caller graph for this function:

◆ clear()

void fedem::fson::Array::clear ( )
noexcept

References elements.

◆ getDanglingComments() [1/2]

CommentList & fedem::fson::Array::getDanglingComments ( )
inlinenoexcept

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

+ Here is the caller graph for this function:

◆ getDanglingComments() [2/2]

CommentList const & fedem::fson::Array::getDanglingComments ( ) const
inlinenoexcept

Member Data Documentation

◆ elements

std::vector< Element > fedem::fson::Array::elements
private

Referenced by append(), clear(), clone(), erase(), and insert().

◆ dangling

CommentList fedem::fson::Array::dangling
private

Referenced by clone().


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