您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ZXAztecState.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 2014 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. @class ZXAztecToken, ZXBitArray, ZXByteArray;
  17. /**
  18. * State represents all information about a sequence necessary to generate the current output.
  19. * Note that a state is immutable.
  20. */
  21. @interface ZXAztecState : NSObject
  22. // The current mode of the encoding (or the mode to which we'll return if
  23. // we're in Binary Shift mode.
  24. @property (nonatomic, assign, readonly) int mode;
  25. // The list of tokens that we output. If we are in Binary Shift mode, this
  26. // token list does *not* yet included the token for those bytes
  27. @property (nonatomic, strong, readonly) ZXAztecToken *token;
  28. // If non-zero, the number of most recent bytes that should be output
  29. // in Binary Shift mode.
  30. @property (nonatomic, assign, readonly) int binaryShiftByteCount;
  31. // The total number of bits generated (including Binary Shift).
  32. @property (nonatomic, assign, readonly) int bitCount;
  33. - (id)initWithToken:(ZXAztecToken *)token mode:(int)mode binaryBytes:(int)binaryBytes bitCount:(int)bitCount;
  34. + (ZXAztecState *)initialState;
  35. - (ZXAztecState *)latchAndAppend:(int)mode value:(int)value;
  36. - (ZXAztecState *)shiftAndAppend:(int)mode value:(int)value;
  37. - (ZXAztecState *)addBinaryShiftChar:(int)index;
  38. - (ZXAztecState *)endBinaryShift:(int)index;
  39. - (BOOL)isBetterThanOrEqualTo:(ZXAztecState *)other;
  40. - (ZXBitArray *)toBitArray:(ZXByteArray *)text;
  41. @end