Mercurial > hg > orthanc
diff Plugins/Engine/PluginsEnumerations.cpp @ 1646:da799f767e5d
simplification in error casting with plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Sep 2015 16:01:09 +0200 |
parents | 1558b3226b18 |
children | 5360cdba70d8 |
line wrap: on
line diff
--- a/Plugins/Engine/PluginsEnumerations.cpp Thu Sep 24 15:55:17 2015 +0200 +++ b/Plugins/Engine/PluginsEnumerations.cpp Thu Sep 24 16:01:09 2015 +0200 @@ -44,283 +44,6 @@ { namespace Plugins { - ErrorCode Convert(OrthancPluginErrorCode error) - { - switch (error) - { - case OrthancPluginErrorCode_InternalError: - return ErrorCode_InternalError; - - case OrthancPluginErrorCode_Success: - return ErrorCode_Success; - - case OrthancPluginErrorCode_Plugin: - return ErrorCode_Plugin; - - case OrthancPluginErrorCode_NotImplemented: - return ErrorCode_NotImplemented; - - case OrthancPluginErrorCode_ParameterOutOfRange: - return ErrorCode_ParameterOutOfRange; - - case OrthancPluginErrorCode_NotEnoughMemory: - return ErrorCode_NotEnoughMemory; - - case OrthancPluginErrorCode_BadParameterType: - return ErrorCode_BadParameterType; - - case OrthancPluginErrorCode_BadSequenceOfCalls: - return ErrorCode_BadSequenceOfCalls; - - case OrthancPluginErrorCode_InexistentItem: - return ErrorCode_InexistentItem; - - case OrthancPluginErrorCode_BadRequest: - return ErrorCode_BadRequest; - - case OrthancPluginErrorCode_NetworkProtocol: - return ErrorCode_NetworkProtocol; - - case OrthancPluginErrorCode_SystemCommand: - return ErrorCode_SystemCommand; - - case OrthancPluginErrorCode_Database: - return ErrorCode_Database; - - case OrthancPluginErrorCode_UriSyntax: - return ErrorCode_UriSyntax; - - case OrthancPluginErrorCode_InexistentFile: - return ErrorCode_InexistentFile; - - case OrthancPluginErrorCode_CannotWriteFile: - return ErrorCode_CannotWriteFile; - - case OrthancPluginErrorCode_BadFileFormat: - return ErrorCode_BadFileFormat; - - case OrthancPluginErrorCode_Timeout: - return ErrorCode_Timeout; - - case OrthancPluginErrorCode_UnknownResource: - return ErrorCode_UnknownResource; - - case OrthancPluginErrorCode_IncompatibleDatabaseVersion: - return ErrorCode_IncompatibleDatabaseVersion; - - case OrthancPluginErrorCode_FullStorage: - return ErrorCode_FullStorage; - - case OrthancPluginErrorCode_CorruptedFile: - return ErrorCode_CorruptedFile; - - case OrthancPluginErrorCode_InexistentTag: - return ErrorCode_InexistentTag; - - case OrthancPluginErrorCode_ReadOnly: - return ErrorCode_ReadOnly; - - case OrthancPluginErrorCode_IncompatibleImageFormat: - return ErrorCode_IncompatibleImageFormat; - - case OrthancPluginErrorCode_IncompatibleImageSize: - return ErrorCode_IncompatibleImageSize; - - case OrthancPluginErrorCode_SharedLibrary: - return ErrorCode_SharedLibrary; - - case OrthancPluginErrorCode_UnknownPluginService: - return ErrorCode_UnknownPluginService; - - case OrthancPluginErrorCode_UnknownDicomTag: - return ErrorCode_UnknownDicomTag; - - case OrthancPluginErrorCode_BadJson: - return ErrorCode_BadJson; - - case OrthancPluginErrorCode_Unauthorized: - return ErrorCode_Unauthorized; - - case OrthancPluginErrorCode_BadFont: - return ErrorCode_BadFont; - - case OrthancPluginErrorCode_DatabasePlugin: - return ErrorCode_DatabasePlugin; - - case OrthancPluginErrorCode_StorageAreaPlugin: - return ErrorCode_StorageAreaPlugin; - - case OrthancPluginErrorCode_SQLiteNotOpened: - return ErrorCode_SQLiteNotOpened; - - case OrthancPluginErrorCode_SQLiteAlreadyOpened: - return ErrorCode_SQLiteAlreadyOpened; - - case OrthancPluginErrorCode_SQLiteCannotOpen: - return ErrorCode_SQLiteCannotOpen; - - case OrthancPluginErrorCode_SQLiteStatementAlreadyUsed: - return ErrorCode_SQLiteStatementAlreadyUsed; - - case OrthancPluginErrorCode_SQLiteExecute: - return ErrorCode_SQLiteExecute; - - case OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction: - return ErrorCode_SQLiteRollbackWithoutTransaction; - - case OrthancPluginErrorCode_SQLiteCommitWithoutTransaction: - return ErrorCode_SQLiteCommitWithoutTransaction; - - case OrthancPluginErrorCode_SQLiteRegisterFunction: - return ErrorCode_SQLiteRegisterFunction; - - case OrthancPluginErrorCode_SQLiteFlush: - return ErrorCode_SQLiteFlush; - - case OrthancPluginErrorCode_SQLiteCannotRun: - return ErrorCode_SQLiteCannotRun; - - case OrthancPluginErrorCode_SQLiteCannotStep: - return ErrorCode_SQLiteCannotStep; - - case OrthancPluginErrorCode_SQLiteBindOutOfRange: - return ErrorCode_SQLiteBindOutOfRange; - - case OrthancPluginErrorCode_SQLitePrepareStatement: - return ErrorCode_SQLitePrepareStatement; - - case OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted: - return ErrorCode_SQLiteTransactionAlreadyStarted; - - case OrthancPluginErrorCode_SQLiteTransactionCommit: - return ErrorCode_SQLiteTransactionCommit; - - case OrthancPluginErrorCode_SQLiteTransactionBegin: - return ErrorCode_SQLiteTransactionBegin; - - case OrthancPluginErrorCode_DirectoryOverFile: - return ErrorCode_DirectoryOverFile; - - case OrthancPluginErrorCode_FileStorageCannotWrite: - return ErrorCode_FileStorageCannotWrite; - - case OrthancPluginErrorCode_DirectoryExpected: - return ErrorCode_DirectoryExpected; - - case OrthancPluginErrorCode_HttpPortInUse: - return ErrorCode_HttpPortInUse; - - case OrthancPluginErrorCode_DicomPortInUse: - return ErrorCode_DicomPortInUse; - - case OrthancPluginErrorCode_BadHttpStatusInRest: - return ErrorCode_BadHttpStatusInRest; - - case OrthancPluginErrorCode_RegularFileExpected: - return ErrorCode_RegularFileExpected; - - case OrthancPluginErrorCode_PathToExecutable: - return ErrorCode_PathToExecutable; - - case OrthancPluginErrorCode_MakeDirectory: - return ErrorCode_MakeDirectory; - - case OrthancPluginErrorCode_BadApplicationEntityTitle: - return ErrorCode_BadApplicationEntityTitle; - - case OrthancPluginErrorCode_NoCFindHandler: - return ErrorCode_NoCFindHandler; - - case OrthancPluginErrorCode_NoCMoveHandler: - return ErrorCode_NoCMoveHandler; - - case OrthancPluginErrorCode_NoCStoreHandler: - return ErrorCode_NoCStoreHandler; - - case OrthancPluginErrorCode_NoApplicationEntityFilter: - return ErrorCode_NoApplicationEntityFilter; - - case OrthancPluginErrorCode_NoSopClassOrInstance: - return ErrorCode_NoSopClassOrInstance; - - case OrthancPluginErrorCode_NoPresentationContext: - return ErrorCode_NoPresentationContext; - - case OrthancPluginErrorCode_DicomFindUnavailable: - return ErrorCode_DicomFindUnavailable; - - case OrthancPluginErrorCode_DicomMoveUnavailable: - return ErrorCode_DicomMoveUnavailable; - - case OrthancPluginErrorCode_CannotStoreInstance: - return ErrorCode_CannotStoreInstance; - - case OrthancPluginErrorCode_CreateDicomNotString: - return ErrorCode_CreateDicomNotString; - - case OrthancPluginErrorCode_CreateDicomOverrideTag: - return ErrorCode_CreateDicomOverrideTag; - - case OrthancPluginErrorCode_CreateDicomUseContent: - return ErrorCode_CreateDicomUseContent; - - case OrthancPluginErrorCode_CreateDicomNoPayload: - return ErrorCode_CreateDicomNoPayload; - - case OrthancPluginErrorCode_CreateDicomUseDataUriScheme: - return ErrorCode_CreateDicomUseDataUriScheme; - - case OrthancPluginErrorCode_CreateDicomBadParent: - return ErrorCode_CreateDicomBadParent; - - case OrthancPluginErrorCode_CreateDicomParentIsInstance: - return ErrorCode_CreateDicomParentIsInstance; - - case OrthancPluginErrorCode_CreateDicomParentEncoding: - return ErrorCode_CreateDicomParentEncoding; - - case OrthancPluginErrorCode_UnknownModality: - return ErrorCode_UnknownModality; - - case OrthancPluginErrorCode_BadJobOrdering: - return ErrorCode_BadJobOrdering; - - case OrthancPluginErrorCode_JsonToLuaTable: - return ErrorCode_JsonToLuaTable; - - case OrthancPluginErrorCode_CannotCreateLua: - return ErrorCode_CannotCreateLua; - - case OrthancPluginErrorCode_CannotExecuteLua: - return ErrorCode_CannotExecuteLua; - - case OrthancPluginErrorCode_LuaAlreadyExecuted: - return ErrorCode_LuaAlreadyExecuted; - - case OrthancPluginErrorCode_LuaBadOutput: - return ErrorCode_LuaBadOutput; - - case OrthancPluginErrorCode_NotLuaPredicate: - return ErrorCode_NotLuaPredicate; - - case OrthancPluginErrorCode_LuaReturnsNoString: - return ErrorCode_LuaReturnsNoString; - - case OrthancPluginErrorCode_StorageAreaAlreadyRegistered: - return ErrorCode_StorageAreaAlreadyRegistered; - - case OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered: - return ErrorCode_DatabaseBackendAlreadyRegistered; - - case OrthancPluginErrorCode_DatabaseNotInitialized: - return ErrorCode_DatabaseNotInitialized; - - default: - return ErrorCode_InternalError; - } - } - - OrthancPluginResourceType Convert(ResourceType type) { switch (type)