Mercurial > hg > orthanc
diff OrthancServer/ServerIndex.cpp @ 224:4eb0c7ce86c9
refactoring for store
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Nov 2012 22:22:00 +0100 |
parents | bb8c260c0092 |
children | 8a26a8e85edf |
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp Thu Nov 29 18:07:50 2012 +0100 +++ b/OrthancServer/ServerIndex.cpp Thu Nov 29 22:22:00 2012 +0100 @@ -350,41 +350,6 @@ } - StoreStatus ServerIndex::Store(FileStorage& storage, - const char* dicomFile, - size_t dicomSize, - const DicomMap& dicomSummary, - const Json::Value& dicomJson, - const std::string& remoteAet) - { - std::string fileUuid = storage.Create(dicomFile, dicomSize); - std::string jsonUuid = storage.Create(dicomJson.toStyledString()); - StoreStatus status = Store(dicomSummary, fileUuid, dicomSize, jsonUuid, remoteAet); - - if (status != StoreStatus_Success) - { - storage.Remove(fileUuid); - storage.Remove(jsonUuid); - } - - switch (status) - { - case StoreStatus_Success: - LOG(INFO) << "New instance stored"; - break; - - case StoreStatus_AlreadyStored: - LOG(INFO) << "Already stored"; - break; - - case StoreStatus_Failure: - LOG(ERROR) << "Store failure"; - break; - } - - return status; - } - uint64_t ServerIndex::GetTotalCompressedSize() { boost::mutex::scoped_lock lock(mutex_);