diff OrthancServer/ServerIndex.cpp @ 438:7bbe77cb9e12

DELETE metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 15 May 2013 16:51:10 +0200
parents d51186bf7602
children 23e5b35e3c5c
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Wed May 15 16:43:30 2013 +0200
+++ b/OrthancServer/ServerIndex.cpp	Wed May 15 16:51:10 2013 +0200
@@ -1123,6 +1123,23 @@
     db_->SetMetadata(id, type, value);
   }
 
+
+  void ServerIndex::DeleteMetadata(const std::string& publicId,
+                                   MetadataType type)
+  {
+    boost::mutex::scoped_lock lock(mutex_);
+
+    ResourceType rtype;
+    int64_t id;
+    if (!db_->LookupResource(publicId, id, rtype))
+    {
+      throw OrthancException(ErrorCode_UnknownResource);
+    }
+
+    db_->DeleteMetadata(id, type);
+  }
+
+
   bool ServerIndex::LookupMetadata(std::string& target,
                                    const std::string& publicId,
                                    MetadataType type)