1
0

HdfException.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /// \copyright Copyright (c) Catalysts GmbH
  2. /// \author Patrik Kovacs, Catalysts GmbH
  3. #include <hdf4cpp/HdfException.h>
  4. const std::string hdf4cpp::HdfException::exceptionMessagePrefix = "HDF4CPP: ";
  5. const std::map<hdf4cpp::ExceptionType, std::string> hdf4cpp::HdfException::exceptionTypeMap = {
  6. {INVALID_ID, "cannot construct object, the id is invalid"},
  7. {INVALID_OPERATION, "operation not supported for this type"},
  8. {INVALID_NAME, "invalid item name"},
  9. {OUT_OF_RANGE,
  10. "out of range, cannot access element (usually thrown when an iterator points to an inaccessible address)"},
  11. {BUFFER_SIZE_NOT_ENOUGH,
  12. "not enough buffer size (usually thrown when the type of the vector in which we read the data is too small)"},
  13. {BUFFER_SIZE_NOT_DIVISIBLE, "buffer cannot be splited up (usually thrown when the size of the readable data is not "
  14. "divisible by the type size of the vector"},
  15. {INVALID_RANGES, "the given ranges are invalids (usually thrown when the ranges is negative or it is bigger than the "
  16. "dimension of tha data)"},
  17. {STATUS_RETURN_FAIL, "hdf routine failed"},
  18. {INVALID_DATA_TYPE, "the type of the data in the hdf item is not supported"},
  19. {OTHER, "exception thrown"},
  20. };
  21. hdf4cpp::Type hdf4cpp::HdfException::getType() const noexcept {
  22. return type;
  23. }
  24. hdf4cpp::ClassType hdf4cpp::HdfException::getClassType() const noexcept {
  25. return classType;
  26. }
  27. hdf4cpp::ExceptionType hdf4cpp::HdfException::getExceptionType() const noexcept {
  28. return exceptionType;
  29. }
  30. std::string hdf4cpp::HdfException::getMessage() const noexcept {
  31. return message;
  32. }