# HG changeset patch # User Sebastien Jodogne # Date 1395219500 -3600 # Node ID 696dbb4fd390db0f764ee2f26b1f7f91e02ad60d # Parent c60743fadd4e44af0133fe36b26b8fbf0f1cc3f3 api uniformization diff -r c60743fadd4e -r 696dbb4fd390 OrthancServer/DatabaseWrapper.cpp --- a/OrthancServer/DatabaseWrapper.cpp Fri Mar 14 11:28:59 2014 +0100 +++ b/OrthancServer/DatabaseWrapper.cpp Wed Mar 19 09:58:20 2014 +0100 @@ -388,7 +388,7 @@ } } - bool DatabaseWrapper::ListAvailableMetadata(std::list& target, + void DatabaseWrapper::ListAvailableMetadata(std::list& target, int64_t id) { target.clear(); @@ -400,8 +400,6 @@ { target.push_back(static_cast(s.ColumnInt(0))); } - - return true; } diff -r c60743fadd4e -r 696dbb4fd390 OrthancServer/DatabaseWrapper.h --- a/OrthancServer/DatabaseWrapper.h Fri Mar 14 11:28:59 2014 +0100 +++ b/OrthancServer/DatabaseWrapper.h Wed Mar 19 09:58:20 2014 +0100 @@ -115,7 +115,7 @@ int64_t id, MetadataType type); - bool ListAvailableMetadata(std::list& target, + void ListAvailableMetadata(std::list& target, int64_t id); std::string GetMetadata(int64_t id, diff -r c60743fadd4e -r 696dbb4fd390 OrthancServer/OrthancRestApi.cpp --- a/OrthancServer/OrthancRestApi.cpp Fri Mar 14 11:28:59 2014 +0100 +++ b/OrthancServer/OrthancRestApi.cpp Wed Mar 19 09:58:20 2014 +0100 @@ -1668,18 +1668,17 @@ std::string publicId = call.GetUriComponent("id", ""); std::list metadata; - if (context.GetIndex().ListAvailableMetadata(metadata, publicId)) - { - Json::Value result = Json::arrayValue; + + context.GetIndex().ListAvailableMetadata(metadata, publicId); + Json::Value result = Json::arrayValue; - for (std::list::const_iterator - it = metadata.begin(); it != metadata.end(); ++it) - { - result.append(EnumerationToString(*it)); - } + for (std::list::const_iterator + it = metadata.begin(); it != metadata.end(); ++it) + { + result.append(EnumerationToString(*it)); + } - call.GetOutput().AnswerJson(result); - } + call.GetOutput().AnswerJson(result); } diff -r c60743fadd4e -r 696dbb4fd390 OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Fri Mar 14 11:28:59 2014 +0100 +++ b/OrthancServer/ServerIndex.cpp Wed Mar 19 09:58:20 2014 +0100 @@ -1238,7 +1238,7 @@ } - bool ServerIndex::ListAvailableMetadata(std::list& target, + void ServerIndex::ListAvailableMetadata(std::list& target, const std::string& publicId) { boost::mutex::scoped_lock lock(mutex_); @@ -1250,7 +1250,7 @@ throw OrthancException(ErrorCode_UnknownResource); } - return db_->ListAvailableMetadata(target, id); + db_->ListAvailableMetadata(target, id); } diff -r c60743fadd4e -r 696dbb4fd390 OrthancServer/ServerIndex.h --- a/OrthancServer/ServerIndex.h Fri Mar 14 11:28:59 2014 +0100 +++ b/OrthancServer/ServerIndex.h Wed Mar 19 09:58:20 2014 +0100 @@ -180,7 +180,7 @@ const std::string& publicId, MetadataType type); - bool ListAvailableMetadata(std::list& target, + void ListAvailableMetadata(std::list& target, const std::string& publicId); void ListAvailableAttachments(std::list& target,