summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/value.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/value.cpp b/src/value.cpp
index 90a67b79f3..8196ce16e2 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -314,6 +314,21 @@ value::operator bool() const
return tag_ != nullptr;
}
+value& value::at(const std::string& key)
+{
+ return dynamic_cast<tag_compound&>(*tag_).at(key);
+}
+
+const value& value::at(const std::string& key) const
+{
+ return dynamic_cast<const tag_compound&>(*tag_).at(key);
+}
+
+value& value::operator[](const std::string& key)
+{
+ return dynamic_cast<tag_compound&>(*tag_)[key];
+}
+
std::unique_ptr<tag>& value::get_ptr()
{
return tag_;