1 #ifndef __DECODED_BIT_STREAM_PARSER_H__
2 #define __DECODED_BIT_STREAM_PARSER_H__
5 * DecodedBitStreamParser.h
8 * Copyright 2010 ZXing authors All rights reserved.
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
25 #include <zxing/qrcode/decoder/Mode.h>
26 #include <zxing/common/BitSource.h>
27 #include <zxing/common/Counted.h>
28 #include <zxing/common/Array.h>
35 class DecodedBitStreamParser {
37 static const char ALPHANUMERIC_CHARS[];
39 static const char *ASCII;
40 static const char *ISO88591;
41 static const char *UTF8;
42 static const char *SHIFT_JIS;
43 static const char *EUC_JP;
45 static void decodeKanjiSegment(Ref<BitSource> bits, std::string &result, int count);
46 static void decodeByteSegment(Ref<BitSource> bits, std::string &result, int count);
47 static void decodeAlphanumericSegment(Ref<BitSource> bits, std::string &result, int count);
48 static void decodeNumericSegment(Ref<BitSource> bits, std::string &result, int count);
49 static const char *guessEncoding(unsigned char *bytes, int length);
50 static void append(std::string &ost, const unsigned char *bufIn, size_t nIn, const char *src);
53 static std::string decode(ArrayRef<unsigned char> bytes, Version *version);
59 #endif // __DECODED_BIT_STREAM_PARSER_H__