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