Fixed issue where the LRC of a card was the reverse of the start
[magread] / magcard.h
1 /*
2     This file is part of MagRead.
3
4     MagRead is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
8
9     MagRead is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with MagRead.  If not, see <http://www.gnu.org/licenses/>.
16     
17     Written by Jeffrey Malone <ieatlint@tehinterweb.com>
18     http://blog.tehinterweb.com
19 */
20 #ifndef MAGCARD_H
21 #define MAGCARD_H
22
23 #include <QDate>
24
25 #include "mslib.h"
26
27 class MagCard {
28         public:
29                 QString charStream;
30                 QString bitStream;
31                 ms_dataType encoding;
32                 bool swipeValid;
33                 enum Type {
34                         CARD_UNSET = 0, // 0000000
35                         CARD_UNKNOWN = 1,//0000001
36                         CARD_AAMVA = 2, // 0000010
37                         CARD_CC = 64,   // 1000000
38                         CARD_AMEX = 68, // 1000100
39                         CARD_DISC = 72, // 1001000
40                         CARD_MC = 80,   // 1010000
41                         CARD_VISA = 96  // 1100000
42                 };
43                 Q_DECLARE_FLAGS( Types, Type );
44                 Types type;
45
46                 QString accountNumber;
47                 QString accountHolder;
48                 QString accountIssuer;
49                 QDate expirationDate;
50                 QString miscData;
51
52
53                 bool accountValid;
54
55                 QString aamvaIssuer;
56                 QString aamvaIssuerName;
57                 QString aamvaIssuerAbr;
58                 QDate aamvaBirthday;
59                 int aamvaAge;
60
61                 MagCard() {
62                         encoding = UNSET;
63                         type = 0;
64                         accountValid = false;
65                         swipeValid = false;
66                 }
67
68 };
69
70 Q_DECLARE_OPERATORS_FOR_FLAGS( MagCard::Types )
71
72 #endif // MAGCARD_H