ctkPluginDatabaseException.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKPLUGINDATABASEEXCEPTION_H
  16. #define CTKPLUGINDATABASEEXCEPTION_H
  17. #include "ctkException.h"
  18. #include <ctkPluginFrameworkExport.h>
  19. /**
  20. * \ingroup PluginFramework
  21. */
  22. class CTK_PLUGINFW_EXPORT ctkPluginDatabaseException : public ctkRuntimeException
  23. {
  24. public:
  25. enum Type {
  26. UNSPECIFIED,
  27. DB_CONNECTION_INVALID,
  28. DB_NOT_OPEN_ERROR,
  29. DB_NOT_FOUND_ERROR,
  30. DB_CREATE_DIR_ERROR,
  31. DB_WRITE_ERROR,
  32. DB_FILE_INVALID,
  33. DB_SQL_ERROR
  34. };
  35. ctkPluginDatabaseException(const QString& msg, const Type& type = UNSPECIFIED);
  36. ctkPluginDatabaseException(const QString& msg, const Type& type, const ctkException& cause);
  37. ctkPluginDatabaseException(const QString& msg, const ctkException& cause);
  38. ctkPluginDatabaseException(const ctkPluginDatabaseException& o);
  39. ctkPluginDatabaseException& operator=(const ctkPluginDatabaseException& o);
  40. ~ctkPluginDatabaseException() throw();
  41. /**
  42. * @see ctkException::name()
  43. */
  44. const char* name() const throw();
  45. /**
  46. * @see ctkException::clone()
  47. */
  48. ctkPluginDatabaseException* clone() const;
  49. /**
  50. * @see ctkException::rethrow()
  51. */
  52. void rethrow() const;
  53. Type getType() const;
  54. private:
  55. Type type;
  56. };
  57. #endif // CTKPLUGINDATABASEEXCEPTION_H