From ef5af06ad1a3631ecf9c769775a2a8fcc3ff0617 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 18 Jun 2023 14:14:41 -0700 Subject: [PATCH] chore: empty dom Array, Object --- include/mrdox/Support/Dom.hpp | 8 +++---- source/Support/Dom.cpp | 39 +++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/include/mrdox/Support/Dom.hpp b/include/mrdox/Support/Dom.hpp index 9c955c7da..1a8367b96 100644 --- a/include/mrdox/Support/Dom.hpp +++ b/include/mrdox/Support/Dom.hpp @@ -152,8 +152,8 @@ class MRDOX_DECL Array : public Any { public: - virtual std::size_t length() const noexcept = 0; - virtual Value get(std::size_t) const = 0; + virtual std::size_t length() const noexcept; + virtual Value get(std::size_t) const; }; using ArrayPtr = Pointer; @@ -165,8 +165,8 @@ class MRDOX_DECL { public: virtual bool empty() const noexcept; - virtual Value get(std::string_view) const = 0; - virtual std::vector props() const = 0; + virtual Value get(std::string_view) const; + virtual std::vector props() const; }; using ObjectPtr = Pointer; diff --git a/source/Support/Dom.cpp b/source/Support/Dom.cpp index 0db88747e..aa4811a4c 100644 --- a/source/Support/Dom.cpp +++ b/source/Support/Dom.cpp @@ -16,11 +16,46 @@ namespace dom { Any::~Any() = default; -bool Object::empty() const noexcept +//------------------------------------------------ + +std::size_t +Array:: +length() const noexcept +{ + return 0; +} + +Value +Array:: +get(std::size_t) const +{ + return nullptr; +} + +bool +Object:: +empty() const noexcept { - return false; + return true; } +Value +Object:: +get(std::string_view) const +{ + return nullptr; +} + +auto +Object:: +props() const -> + std::vector +{ + return {}; +} + +//------------------------------------------------ + Value:: ~Value() {