Result.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __RESULT_H__
  2. #define __RESULT_H__
  3. /*
  4. * Result.h
  5. * zxing
  6. *
  7. * Copyright 2010 ZXing authors All rights reserved.
  8. *
  9. * Licensed under the Apache License, Version 2.0 (the "License");
  10. * you may not use this file except in compliance with the License.
  11. * You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing, software
  16. * distributed under the License is distributed on an "AS IS" BASIS,
  17. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. * See the License for the specific language governing permissions and
  19. * limitations under the License.
  20. */
  21. #include <string>
  22. #include <zxing/common/Array.h>
  23. #include <zxing/common/Counted.h>
  24. #include <zxing/common/Str.h>
  25. #include <zxing/ResultPoint.h>
  26. #include <zxing/BarcodeFormat.h>
  27. namespace zxing {
  28. class Result : public Counted {
  29. private:
  30. Ref<String> text_;
  31. ArrayRef<char> rawBytes_;
  32. ArrayRef< Ref<ResultPoint> > resultPoints_;
  33. BarcodeFormat format_;
  34. public:
  35. Result(Ref<String> text,
  36. ArrayRef<char> rawBytes,
  37. ArrayRef< Ref<ResultPoint> > resultPoints,
  38. BarcodeFormat format);
  39. ~Result();
  40. Ref<String> getText();
  41. ArrayRef<char> getRawBytes();
  42. ArrayRef< Ref<ResultPoint> > const& getResultPoints() const;
  43. ArrayRef< Ref<ResultPoint> >& getResultPoints();
  44. BarcodeFormat getBarcodeFormat() const;
  45. friend std::ostream& operator<<(std::ostream &out, Result& result);
  46. };
  47. }
  48. #endif // __RESULT_H__