comparison OrthancServer/ServerIndex.cpp @ 697:dd1ce9a2844c

access to attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Feb 2014 16:46:59 +0100
parents 2d0a347e8cfc
children 2929e17f8447
comparison
equal deleted inserted replaced
696:4c1860179cc5 697:dd1ce9a2844c
1222 1222
1223 return db_->ListAvailableMetadata(target, id); 1223 return db_->ListAvailableMetadata(target, id);
1224 } 1224 }
1225 1225
1226 1226
1227 void ServerIndex::ListAvailableAttachments(std::list<FileContentType>& target,
1228 const std::string& publicId,
1229 ResourceType expectedType)
1230 {
1231 boost::mutex::scoped_lock lock(mutex_);
1232
1233 ResourceType type;
1234 int64_t id;
1235 if (!db_->LookupResource(publicId, id, type) ||
1236 expectedType != type)
1237 {
1238 throw OrthancException(ErrorCode_UnknownResource);
1239 }
1240
1241 db_->ListAvailableAttachments(target, id);
1242 }
1243
1244
1227 bool ServerIndex::LookupParent(std::string& target, 1245 bool ServerIndex::LookupParent(std::string& target,
1228 const std::string& publicId) 1246 const std::string& publicId)
1229 { 1247 {
1230 boost::mutex::scoped_lock lock(mutex_); 1248 boost::mutex::scoped_lock lock(mutex_);
1231 1249