You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ZXErrors.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2012 ZXing authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #define ZXErrorDomain @"ZXErrorDomain"
  17. enum {
  18. /**
  19. * Thrown when a barcode was successfully detected and decoded, but
  20. * was not returned because its checksum feature failed.
  21. */
  22. ZXChecksumError = 1000,
  23. /**
  24. * Thrown when a barcode was successfully detected, but some aspect of
  25. * the content did not conform to the barcode's format rules. This could have
  26. * been due to a mis-detection.
  27. */
  28. ZXFormatError = 1001,
  29. /**
  30. * Thrown when a barcode was not found in the image. It might have been
  31. * partially detected but could not be confirmed.
  32. */
  33. ZXNotFoundError = 1002,
  34. /**
  35. * Thrown when an exception occurs during Reed-Solomon decoding, such as when
  36. * there are too many errors to correct.
  37. */
  38. ZXReedSolomonError = 1003,
  39. /**
  40. * This general error is thrown when something goes wrong during decoding of a barcode.
  41. * This includes, but is not limited to, failing checksums / error correction algorithms, being
  42. * unable to locate finder timing patterns, and so on.
  43. */
  44. ZXReaderError = 1004,
  45. /**
  46. * Covers the range of error which may occur when encoding a barcode using the Writer framework.
  47. */
  48. ZXWriterError = 1005
  49. };
  50. // Helper methods for error instances
  51. NSError *ZXChecksumErrorInstance(void);
  52. NSError *ZXFormatErrorInstance(void);
  53. NSError *ZXNotFoundErrorInstance(void);