|
fson
1.0.2
A comment-preserving C++ library for FSON — a human-friendly superset of JSON / JSON5
|
#include <Object.hh>
Inheritance diagram for fedem::fson::Object:
Collaboration diagram for fedem::fson::Object:Classes | |
| struct | Entry |
| struct | Provenance |
Public Types | |
| enum class | EntryKind { Member , Include } |
Public Types inherited from fedem::fson::Value | |
| enum class | Type { Null , Boolean , Number , String , Array , Object } |
Public Member Functions | |
| Object ()=default | |
| Type | getType () const noexcept override |
| std::unique_ptr< Value > | clone () const override |
| Object * | asObject () noexcept override |
| Object const * | asObject () const noexcept override |
| std::size_t | size () const noexcept |
| bool | empty () const noexcept |
| bool | contains (std::string const &name) const noexcept |
| Value * | find (std::string const &name) noexcept |
| Value const * | find (std::string const &name) const noexcept |
| Value & | at (std::string const &name) |
| Value const & | at (std::string const &name) const |
| Value & | set (Key key, std::unique_ptr< Value > value) |
| Value & | set (std::string const &name, std::unique_ptr< Value > value) |
| bool | remove (std::string const &name) noexcept |
| bool | disable (std::string const &name) noexcept |
| bool | enable (std::string const &name) noexcept |
| Value * | findPath (std::string const &path) noexcept |
| Value const * | findPath (std::string const &path) const noexcept |
| bool | containsPath (std::string const &path) const noexcept |
| Value & | atPath (std::string const &path) |
| Value const & | atPath (std::string const &path) const |
| Value * | setPath (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< Provenance > | provenanceOf (std::string const &path) const |
| std::vector< Provenance > | provenanceMap () 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 |
| std::size_t | memberCount () const noexcept |
| Member & | getMember (std::size_t index) |
| Member const & | getMember (std::size_t index) const |
| Member & | appendMember (Member member) |
| void | eraseMember (std::size_t index) |
| std::size_t | includeCount () const noexcept |
| Include & | getInclude (std::size_t index) |
| Include const & | getInclude (std::size_t index) const |
| Include & | appendInclude (Include include) |
| void | eraseInclude (std::size_t index) |
| std::size_t | entryCount () const noexcept |
| Entry const & | getEntry (std::size_t position) const |
| CommentList & | getDanglingComments () 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 Null * | asNull () noexcept |
| virtual Null const * | asNull () const noexcept |
| virtual Boolean * | asBoolean () noexcept |
| virtual Boolean const * | asBoolean () const noexcept |
| virtual Number * | asNumber () noexcept |
| virtual Number const * | asNumber () const noexcept |
| virtual String * | asString () noexcept |
| virtual String const * | asString () const noexcept |
| virtual Array * | asArray () noexcept |
| virtual Array const * | asArray () const noexcept |
Private Member Functions | |
| std::size_t | findActiveIndex (std::string const &name) const noexcept |
| void | rebuildEntryIndices (EntryKind kind, std::size_t removedIndex) noexcept |
| Member const * | findOwningMember (std::string const &path) const noexcept |
Private Attributes | |
| std::vector< Member > | members |
| std::vector< Include > | includes |
| std::vector< Entry > | entries |
| CommentList | dangling |
Static Private Attributes | |
| static constexpr std::size_t const | NPOS = static_cast< std::size_t >( -1 ) |
Additional Inherited Members | |
Protected Member Functions inherited from fedem::fson::Value | |
| Value ()=default | |
|
strong |
|
default |
|
inlineoverridevirtualnoexcept |
Implements fedem::fson::Value.
|
overridevirtual |
Implements fedem::fson::Value.
|
inlineoverridevirtualnoexcept |
Reimplemented from fedem::fson::Value.
|
inlineoverridevirtualnoexcept |
Reimplemented from fedem::fson::Value.
|
noexcept |
References members.
|
inlinenoexcept |
|
inlinenoexcept |
References fedem::fson::Key::name.
|
noexcept |
References index.
Referenced by at(), findOwningMember(), findPath(), removePath(), and setPath().
Here is the caller graph for this function:
|
noexcept |
References index.
| Value & fedem::fson::Object::at | ( | std::string const & | name | ) |
| Value const & fedem::fson::Object::at | ( | std::string const & | name | ) | const |
References fedem::fson::Key::bare(), fedem::fson::Key::isValidName(), key, fedem::fson::Key::quoted(), and set().
Here is the call graph for this function:
|
noexcept |
References index.
Referenced by removePath(), and setPath().
Here is the caller graph for this function:
|
noexcept |
References index.
|
noexcept |
|
noexcept |
References fedem::fson::Value::asArray(), fedem::fson::Value::asObject(), fedem::fson::Array::at(), find(), and fedem::fson::Array::size().
Referenced by atPath(), getString(), and provenanceOf().
Here is the call graph for this function:
Here is the caller graph for this function:
|
noexcept |
|
noexcept |
| Value & fedem::fson::Object::atPath | ( | std::string const & | path | ) |
| Value const & fedem::fson::Object::atPath | ( | std::string const & | path | ) | const |
References fedem::fson::Value::asArray(), fedem::fson::Value::asObject(), fedem::fson::Array::at(), find(), fedem::fson::Array::getElement(), remove(), set(), fedem::fson::Element::setValue(), and fedem::fson::Array::size().
Here is the call graph for this function:
|
noexcept |
References fedem::fson::Value::asArray(), fedem::fson::Value::asObject(), fedem::fson::Array::at(), fedem::fson::Array::erase(), find(), remove(), and fedem::fson::Array::size().
Here is the call graph for this function:
|
noexcept |
| optional< Object::Provenance > fedem::fson::Object::provenanceOf | ( | std::string const & | path | ) | const |
References findOwningMember(), findPath(), fedem::fson::Member::getOriginFile(), fedem::fson::Member::getOriginLocalPath(), and fedem::fson::Member::isMerged().
Here is the call graph for this function:| std::vector< Object::Provenance > fedem::fson::Object::provenanceMap | ( | ) | const |
References fedem::fson::Member::getKey(), fedem::fson::Key::getName(), fedem::fson::Member::getOriginFile(), fedem::fson::Member::getOriginLocalPath(), index, fedem::fson::Member::isDisabled(), fedem::fson::Member::isMerged(), and members.
Here is the call graph for this function:| string fedem::fson::Object::getString | ( | std::string const & | path, |
| std::string const & | fallback = std::string( ) |
||
| ) | const |
References fedem::fson::Value::asString(), findPath(), fedem::fson::String::getValue(), and fedem::fson::Value::isString().
Here is the call graph for this function:
|
noexcept |
References fedem::fson::Number::asInteger(), fedem::fson::Value::asNumber(), and fedem::fson::Value::isNumber().
Here is the call graph for this function:
|
noexcept |
References fedem::fson::Number::asDouble(), fedem::fson::Value::asNumber(), and fedem::fson::Value::isNumber().
Here is the call graph for this function:
|
noexcept |
References fedem::fson::Value::asBoolean(), fedem::fson::Boolean::getValue(), and fedem::fson::Value::isBoolean().
Here is the call graph for this function:
|
inlinenoexcept |
Referenced by fedem::fson::IncludeResolver::resolveObject().
Here is the caller graph for this function:| Member& fedem::fson::Object::getMember | ( | std::size_t | index | ) |
Referenced by fedem::fson::IncludeResolver::resolveObject().
Here is the caller graph for this function:| Member const& fedem::fson::Object::getMember | ( | std::size_t | index | ) | const |
| void fedem::fson::Object::eraseMember | ( | std::size_t | index | ) |
References index, Member, members, and rebuildEntryIndices().
Here is the call graph for this function:
|
inlinenoexcept |
| Include& fedem::fson::Object::getInclude | ( | std::size_t | index | ) |
| Include const& fedem::fson::Object::getInclude | ( | std::size_t | index | ) | const |
| void fedem::fson::Object::eraseInclude | ( | std::size_t | index | ) |
References Include, includes, index, and rebuildEntryIndices().
Here is the call graph for this function:
|
inlinenoexcept |
| Object::Entry const & fedem::fson::Object::getEntry | ( | std::size_t | position | ) | const |
References entries.
|
inlinenoexcept |
|
inlinenoexcept |
|
privatenoexcept |
References index.
Referenced by findOwningMember(), and set().
Here is the caller graph for this function:
|
privatenoexcept |
References fedem::fson::Object::Entry::index, kind, and fedem::fson::Object::Entry::kind.
Referenced by eraseInclude(), and eraseMember().
Here is the caller graph for this function:
|
privatenoexcept |
References fedem::fson::Value::asArray(), fedem::fson::Value::asObject(), fedem::fson::Array::at(), find(), findActiveIndex(), index, members, and fedem::fson::Array::size().
Referenced by provenanceOf().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by appendMember(), clone(), eraseMember(), findOwningMember(), provenanceMap(), set(), and size().
|
private |
Referenced by appendInclude(), clone(), and eraseInclude().
|
private |
Referenced by appendInclude(), appendMember(), clone(), getEntry(), and set().
|
private |
Referenced by clone().
|
staticconstexprprivate |
Referenced by set().