Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

cttlv.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 $RCSfile: cttlv.h,v $ 00003 ------------------- 00004 cvs : $Id: cttlv.h,v 1.2 2003/01/10 20:02:17 aquamaniac Exp $ 00005 begin : Fri May 03 2002 00006 copyright : (C) 2002 by Martin Preuss 00007 email : martin@libchipcard.de 00008 00009 *************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00024 * MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 /* 00029 Changes 00030 00031 */ 00032 00033 #ifndef CTTLV_H 00034 #define CTTLV_H 00035 00036 class CTTLV; 00037 class CTTLV_FCI; 00038 00039 #define k_CTTLV_CLASS_UNIVERSAL 0x00 00040 #define k_CTTLV_CLASS_APPLICATION 0x40 00041 #define k_CTTLV_CLASS_CONTEXT 0x80 00042 #define k_CTTLV_CLASS_PRIVATE 0xc0 00043 #define k_CTTLV_TYPE_CONSTRUCTED 0x20 00044 00045 00046 #include <string> 00047 00048 00049 00060 class CHIPCARD_API CTTLV { 00061 private: 00062 unsigned int _type; 00063 unsigned int _tag; 00064 unsigned int _length; 00065 string _value; 00066 unsigned int _size; 00067 bool _valid; 00068 bool _simple; 00069 00070 public: 00071 CTTLV(); 00072 00083 CTTLV(const string &s, unsigned int &pos, bool simple=false); 00084 00091 CTTLV(unsigned int tag, unsigned int cl, bool cstrc,string d); 00092 00098 CTTLV(unsigned int tag, string d); 00099 ~CTTLV(); 00100 unsigned int getTag() const { return _tag;}; 00101 unsigned int getLength() const { return _length;}; 00102 string getValue() const { return _value;}; 00103 unsigned int getSize() const { return _size;}; 00104 bool isValid() const { return _valid;}; 00105 00111 bool isConstructed() const { return _type &0x20;}; 00112 00113 bool isSimple() const { return _simple;}; 00114 00119 unsigned int getClass() const { return _type & 0xc0;}; 00120 00124 string toString(); 00125 00126 }; 00127 00128 00129 00133 class CHIPCARD_API CTTLV_FCI { 00134 private: 00135 protected: 00140 virtual void parseTag(CTPointer<CTTLV> tag); 00141 public: 00142 unsigned int fileSize; 00143 unsigned int fileSizeRaw; 00144 unsigned int fileId; 00145 string fileType; 00146 bool isEF; 00147 string fileDescription; 00148 string fileAttributes; 00149 unsigned int maxRecordLength; 00150 string fileName; 00151 bool isTransparent; 00152 bool isLinear; 00153 bool isFixed; 00154 bool isVariable; 00155 bool isCyclic; 00156 bool isSimpleTLV; 00157 00164 CTTLV_FCI(string fci); 00165 00166 CTTLV_FCI(); 00167 virtual ~CTTLV_FCI(); 00168 00169 00170 00171 }; 00172 00173 00174 00175 00176 #endif 00177 00178 00179 00180 00181 00182

Generated on Wed Jul 28 14:56:49 2004 for libchipcard by doxygen 1.3.7