Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
437:beca6747945e | 438:7bbe77cb9e12 |
---|---|
1121 } | 1121 } |
1122 | 1122 |
1123 db_->SetMetadata(id, type, value); | 1123 db_->SetMetadata(id, type, value); |
1124 } | 1124 } |
1125 | 1125 |
1126 | |
1127 void ServerIndex::DeleteMetadata(const std::string& publicId, | |
1128 MetadataType type) | |
1129 { | |
1130 boost::mutex::scoped_lock lock(mutex_); | |
1131 | |
1132 ResourceType rtype; | |
1133 int64_t id; | |
1134 if (!db_->LookupResource(publicId, id, rtype)) | |
1135 { | |
1136 throw OrthancException(ErrorCode_UnknownResource); | |
1137 } | |
1138 | |
1139 db_->DeleteMetadata(id, type); | |
1140 } | |
1141 | |
1142 | |
1126 bool ServerIndex::LookupMetadata(std::string& target, | 1143 bool ServerIndex::LookupMetadata(std::string& target, |
1127 const std::string& publicId, | 1144 const std::string& publicId, |
1128 MetadataType type) | 1145 MetadataType type) |
1129 { | 1146 { |
1130 boost::mutex::scoped_lock lock(mutex_); | 1147 boost::mutex::scoped_lock lock(mutex_); |