summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-06-30 17:45:50 +0200
committerljfa-ag <ljfa-ag@web.de>2015-06-30 17:45:50 +0200
commit49ce5a019c5f8e4d862432734a42bc7aa2a18387 (patch)
tree34485de7d6d1ad1b68ebc4262fa73893a1551d20 /src
parent5390c8e5a84aa4bbbf87981dbe13f60b0ee96655 (diff)
downloadProject-Tick-49ce5a019c5f8e4d862432734a42bc7aa2a18387.tar.gz
Project-Tick-49ce5a019c5f8e4d862432734a42bc7aa2a18387.zip
Change interfaces of tag_compound and value once again
Diffstat (limited to 'src')
-rw-r--r--src/tag_compound.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tag_compound.cpp b/src/tag_compound.cpp
index af0d685826..5e9d81aaf7 100644
--- a/src/tag_compound.cpp
+++ b/src/tag_compound.cpp
@@ -37,6 +37,21 @@ value& tag_compound::operator[](const std::string& key)
return tags[key];
}
+bool tag_compound::put(const std::string& key, std::unique_ptr<tag>&& t)
+{
+ auto it = tags.find(key);
+ if(it != tags.end())
+ {
+ it->second = std::move(t);
+ return false;
+ }
+ else
+ {
+ tags.emplace(key, value(std::move(t)));
+ return true;
+ }
+}
+
bool tag_compound::erase(const std::string& key)
{
return tags.erase(key) != 0;