Mercurial > hg > orthanc
diff OrthancServer/DatabaseWrapper.cpp @ 1237:0f3716b88af7
cleaning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Dec 2014 15:33:16 +0100 |
parents | 178de5edc0a8 |
children | 6c07108ff1e2 |
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp Fri Dec 05 14:53:30 2014 +0100 +++ b/OrthancServer/DatabaseWrapper.cpp Fri Dec 05 15:33:16 2014 +0100 @@ -259,7 +259,8 @@ throw OrthancException(ErrorCode_InternalError); } - LogChange(id, changeType, type, publicId); + ServerIndexChange change(changeType, type, publicId); + LogChange(id, change); return id; } @@ -449,28 +450,6 @@ } - bool DatabaseWrapper::GetMetadataAsInteger(int& result, - int64_t id, - MetadataType type) - { - std::string s = GetMetadata(id, type, ""); - if (s.size() == 0) - { - return false; - } - - try - { - result = boost::lexical_cast<int>(s); - return true; - } - catch (boost::bad_lexical_cast&) - { - return false; - } - } - - void DatabaseWrapper::AddAttachment(int64_t id, const FileInfo& attachment) @@ -1046,33 +1025,6 @@ } - uint64_t DatabaseWrapper::IncrementGlobalSequence(GlobalProperty property) - { - std::string oldValue; - - if (LookupGlobalProperty(oldValue, property)) - { - uint64_t oldNumber; - - try - { - oldNumber = boost::lexical_cast<uint64_t>(oldValue); - SetGlobalProperty(property, boost::lexical_cast<std::string>(oldNumber + 1)); - return oldNumber + 1; - } - catch (boost::bad_lexical_cast&) - { - throw OrthancException(ErrorCode_InternalError); - } - } - else - { - // Initialize the sequence at "1" - SetGlobalProperty(property, "1"); - return 1; - } - } - void DatabaseWrapper::ClearTable(const std::string& tableName) {