exceptions.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. This file was auto-generated by mupdfwrap.py.
  3. */
  4. #ifndef MUPDF_EXCEPTIONS_H
  5. #define MUPDF_EXCEPTIONS_H
  6. #include <stdexcept>
  7. #include <string>
  8. #include "mupdf/fitz.h"
  9. namespace mupdf
  10. {
  11. /** Base class for exceptions. */
  12. struct FzErrorBase : std::exception
  13. {
  14. int m_code;
  15. std::string m_text;
  16. mutable std::string m_what;
  17. FZ_FUNCTION const char* what() const throw();
  18. FZ_FUNCTION FzErrorBase(int code, const char* text);
  19. };
  20. /** For `FZ_ERROR_NONE`. */
  21. struct FzErrorNone : FzErrorBase
  22. {
  23. FZ_FUNCTION FzErrorNone(const char* message);
  24. };
  25. /** For `FZ_ERROR_GENERIC`. */
  26. struct FzErrorGeneric : FzErrorBase
  27. {
  28. FZ_FUNCTION FzErrorGeneric(const char* message);
  29. };
  30. /** For `FZ_ERROR_SYSTEM`. */
  31. struct FzErrorSystem : FzErrorBase
  32. {
  33. FZ_FUNCTION FzErrorSystem(const char* message);
  34. };
  35. /** For `FZ_ERROR_LIBRARY`. */
  36. struct FzErrorLibrary : FzErrorBase
  37. {
  38. FZ_FUNCTION FzErrorLibrary(const char* message);
  39. };
  40. /** For `FZ_ERROR_ARGUMENT`. */
  41. struct FzErrorArgument : FzErrorBase
  42. {
  43. FZ_FUNCTION FzErrorArgument(const char* message);
  44. };
  45. /** For `FZ_ERROR_LIMIT`. */
  46. struct FzErrorLimit : FzErrorBase
  47. {
  48. FZ_FUNCTION FzErrorLimit(const char* message);
  49. };
  50. /** For `FZ_ERROR_UNSUPPORTED`. */
  51. struct FzErrorUnsupported : FzErrorBase
  52. {
  53. FZ_FUNCTION FzErrorUnsupported(const char* message);
  54. };
  55. /** For `FZ_ERROR_FORMAT`. */
  56. struct FzErrorFormat : FzErrorBase
  57. {
  58. FZ_FUNCTION FzErrorFormat(const char* message);
  59. };
  60. /** For `FZ_ERROR_SYNTAX`. */
  61. struct FzErrorSyntax : FzErrorBase
  62. {
  63. FZ_FUNCTION FzErrorSyntax(const char* message);
  64. };
  65. /** For `FZ_ERROR_TRYLATER`. */
  66. struct FzErrorTrylater : FzErrorBase
  67. {
  68. FZ_FUNCTION FzErrorTrylater(const char* message);
  69. };
  70. /** For `FZ_ERROR_ABORT`. */
  71. struct FzErrorAbort : FzErrorBase
  72. {
  73. FZ_FUNCTION FzErrorAbort(const char* message);
  74. };
  75. /** For `FZ_ERROR_REPAIRED`. */
  76. struct FzErrorRepaired : FzErrorBase
  77. {
  78. FZ_FUNCTION FzErrorRepaired(const char* message);
  79. };
  80. /** Throw exception appropriate for error in `ctx`. */
  81. FZ_FUNCTION void internal_throw_exception(fz_context* ctx);
  82. } /* End of namespace mupdf. */
  83. #endif