diff options
author | rtk0c <[email protected]> | 2022-06-27 18:27:13 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-27 18:27:13 -0700 |
commit | 8f0dda5eab181b0f14f2652b4e984aaaae3f258c (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /core/src/Model/Workflow/Values/Dictionary.cpp | |
parent | fad6a88a13ab1f888ab25ad0aae19c1d63aa0623 (diff) |
Start from a clean slate
Diffstat (limited to 'core/src/Model/Workflow/Values/Dictionary.cpp')
-rw-r--r-- | core/src/Model/Workflow/Values/Dictionary.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/core/src/Model/Workflow/Values/Dictionary.cpp b/core/src/Model/Workflow/Values/Dictionary.cpp deleted file mode 100644 index 106e48d..0000000 --- a/core/src/Model/Workflow/Values/Dictionary.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "Dictionary.hpp" - -#include "Utils/Macros.hpp" - -bool DictionaryValue::IsInstance(const BaseValue* value) -{ - return value->GetKind() == KD_Dictionary; -} - -DictionaryValue::DictionaryValue() - : BaseValue(KD_Dictionary) -{ -} - -int DictionaryValue::GetCount() const -{ - return mElements.size(); -} - -BaseValue* DictionaryValue::Find(std::string_view key) -{ - auto iter = mElements.find(key); - if (iter != mElements.end()) { - return iter.value().get(); - } else { - return nullptr; - } -} - -BaseValue* DictionaryValue::Insert(std::string_view key, std::unique_ptr<BaseValue>& value) -{ - auto [iter, success] = mElements.insert(key, std::move(value)); - if (success) { - return iter.value().get(); - } else { - return nullptr; - } -} - -BaseValue& DictionaryValue::InsertOrReplace(std::string_view key, std::unique_ptr<BaseValue> value) -{ - auto [iter, DISCARD] = mElements.emplace(key, std::move(value)); - return *iter.value(); -} - -void DictionaryValue::Remove(std::string_view key) -{ - mElements.erase(mElements.find(key)); -} |