Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp @ 4628:5fabef29c4ff db-changes
added new primitive "hasRevisionsSupport" in database SDK, added "CheckRevisions" to URI "/system"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 20 Apr 2021 15:59:31 +0200 |
parents | f7d5372b59b3 |
children | f0038043fb97 7053502fbf97 |
comparison
equal
deleted
inserted
replaced
4627:f7d5372b59b3 | 4628:5fabef29c4ff |
---|---|
1045 } | 1045 } |
1046 } | 1046 } |
1047 }; | 1047 }; |
1048 | 1048 |
1049 | 1049 |
1050 void OrthancPluginDatabaseV3::CheckSuccess(OrthancPluginErrorCode code) | 1050 void OrthancPluginDatabaseV3::CheckSuccess(OrthancPluginErrorCode code) const |
1051 { | 1051 { |
1052 if (code != OrthancPluginErrorCode_Success) | 1052 if (code != OrthancPluginErrorCode_Success) |
1053 { | 1053 { |
1054 errorDictionary_.LogError(code, true); | 1054 errorDictionary_.LogError(code, true); |
1055 throw OrthancException(static_cast<ErrorCode>(code)); | 1055 throw OrthancException(static_cast<ErrorCode>(code)); |
1102 CHECK_FUNCTION_EXISTS(backend_, destructDatabase); | 1102 CHECK_FUNCTION_EXISTS(backend_, destructDatabase); |
1103 CHECK_FUNCTION_EXISTS(backend_, getDatabaseVersion); | 1103 CHECK_FUNCTION_EXISTS(backend_, getDatabaseVersion); |
1104 CHECK_FUNCTION_EXISTS(backend_, upgradeDatabase); | 1104 CHECK_FUNCTION_EXISTS(backend_, upgradeDatabase); |
1105 CHECK_FUNCTION_EXISTS(backend_, startTransaction); | 1105 CHECK_FUNCTION_EXISTS(backend_, startTransaction); |
1106 CHECK_FUNCTION_EXISTS(backend_, destructTransaction); | 1106 CHECK_FUNCTION_EXISTS(backend_, destructTransaction); |
1107 CHECK_FUNCTION_EXISTS(backend_, hasRevisionsSupport); | |
1107 | 1108 |
1108 CHECK_FUNCTION_EXISTS(backend_, rollback); | 1109 CHECK_FUNCTION_EXISTS(backend_, rollback); |
1109 CHECK_FUNCTION_EXISTS(backend_, commit); | 1110 CHECK_FUNCTION_EXISTS(backend_, commit); |
1110 | 1111 |
1111 CHECK_FUNCTION_EXISTS(backend_, addAttachment); | 1112 CHECK_FUNCTION_EXISTS(backend_, addAttachment); |
1229 errorDictionary_.LogError(code, true); | 1230 errorDictionary_.LogError(code, true); |
1230 throw OrthancException(static_cast<ErrorCode>(code)); | 1231 throw OrthancException(static_cast<ErrorCode>(code)); |
1231 } | 1232 } |
1232 } | 1233 } |
1233 } | 1234 } |
1235 | |
1236 | |
1237 bool OrthancPluginDatabaseV3::HasRevisionsSupport() const | |
1238 { | |
1239 // WARNING: This method requires "Open()" to have been called | |
1240 uint8_t hasRevisions; | |
1241 CheckSuccess(backend_.hasRevisionsSupport(database_, &hasRevisions)); | |
1242 return (hasRevisions != 0); | |
1243 } | |
1234 } | 1244 } |