~lidaobing/+junk/zhcon

« back to all changes in this revision

Viewing changes to src/gbdecoder.cpp

  • Committer: LI Daobing
  • Date: 2008-11-04 04:39:18 UTC
  • Revision ID: lidaobing@gmail.com-20081104043918-nfwwvgfb0uied0mt
importĀ 1:0.2.6-5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vi:ts=4:shiftwidth=4:expandtab
 
2
/***************************************************************************
 
3
                          gbdecoder.cpp  -  description
 
4
                             -------------------
 
5
    begin                : Thu Mar 22 2001
 
6
    copyright            : (C) 2001 by ejoy
 
7
    email                : ejoy@users.sourceforge.net
 
8
 ***************************************************************************/
 
9
 
 
10
/***************************************************************************
 
11
 *                                                                         *
 
12
 *   This program is free software; you can redistribute it and/or modify  *
 
13
 *   it under the terms of the GNU General Public License as published by  *
 
14
 *   the Free Software Foundation; either version 2 of the License, or     *
 
15
 *   (at your option) any later version.                                   *
 
16
 *                                                                         *
 
17
 ***************************************************************************/
 
18
 
 
19
#include "gbdecoder.h"
 
20
 
 
21
GBDecoder::GBDecoder() {}
 
22
 
 
23
GBDecoder::~GBDecoder() {}
 
24
 
 
25
//check if c is byte1 of a gbcode
 
26
bool GBDecoder::IsCode1(char c) {
 
27
    return (c >= 0xA1 && c <= 0xF7);
 
28
}
 
29
 
 
30
//check if c is byte2 of a gbcode
 
31
bool GBDecoder::IsCode2(char c) {
 
32
    return (c >= 0xA1 && c <= 0xFE);
 
33
}
 
34
 
 
35
unsigned int GBDecoder::Index(char c1, char c2) {
 
36
    return (c1 - 0xa1) * 94 + c2 - 0xa1;
 
37
}