Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ZXDecoderResult.m 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #import "ZXDecoderResult.h"
  17. @implementation ZXDecoderResult
  18. - (id)initWithRawBytes:(ZXByteArray *)rawBytes text:(NSString *)text
  19. byteSegments:(NSMutableArray *)byteSegments ecLevel:(NSString *)ecLevel {
  20. return [self initWithRawBytes:rawBytes text:text byteSegments:byteSegments ecLevel:ecLevel saSequence:-1 saParity:-1];
  21. }
  22. - (id)initWithRawBytes:(ZXByteArray *)rawBytes text:(NSString *)text
  23. byteSegments:(NSMutableArray *)byteSegments ecLevel:(NSString *)ecLevel
  24. saSequence:(int)saSequence saParity:(int)saParity {
  25. if (self = [super init]) {
  26. _rawBytes = rawBytes;
  27. _text = text;
  28. _byteSegments = byteSegments;
  29. _ecLevel = ecLevel;
  30. _structuredAppendParity = saParity;
  31. _structuredAppendSequenceNumber = saSequence;
  32. }
  33. return self;
  34. }
  35. - (BOOL)hasStructuredAppend {
  36. return self.structuredAppendParity >= 0 && self.structuredAppendSequenceNumber >= 0;
  37. }
  38. @end