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.
27 #include "../../common/BitSource.h"
28 #include "../../common/Counted.h"
29 #include "../../common/Array.h"
36 using namespace common;
39 class DecodedBitStreamParser {
41 static char ALPHANUMERIC_CHARS[];
44 static char *ISO88591;
46 static char *SHIFT_JIS;
49 static void decodeKanjiSegment(Ref<BitSource> bits,
50 ostringstream &result,
52 static void decodeByteSegment(Ref<BitSource> bits,
53 ostringstream &result,
55 static void decodeAlphanumericSegment(Ref<BitSource> bits,
56 ostringstream &result,
58 static void decodeNumericSegment(Ref<BitSource> bits,
59 ostringstream &result,
61 static char *guessEncoding(unsigned char *bytes, int length);
62 static void append(ostream &ost, unsigned char *bufIn,
63 size_t nIn, const char *src);
66 static string decode(ArrayRef<unsigned char> bytes, Version *version);
72 #endif // __DECODED_BIT_STREAM_PARSER_H__