00001 /* ParseBinary.h 00002 00003 Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 Or, point your browser to http://www.gnu.org/copyleft/gpl.html 00019 00020 */ 00021 00022 00023 #if !defined(PARSEBIN_H) 00024 #define PARSEBIN_H 00025 00026 #include <qcstring.h> 00027 00028 class MHOctetString; 00029 class MHGroup; 00030 00031 #include "ParseNode.h" 00032 00033 class MHParseBinary: public MHParseBase 00034 { 00035 public: 00036 MHParseBinary(QByteArray &program); 00037 virtual ~MHParseBinary() {} 00038 00039 // Parse the binary and return a pointer to the parse tree 00040 virtual MHParseNode *Parse() { return DoParse(); } 00041 00042 private: 00043 MHParseNode *DoParse(); 00044 unsigned char GetNextChar(); 00045 void ParseString(int endStr, MHOctetString &str); 00046 int ParseInt(int endInt); 00047 00048 private: 00049 int m_p; // Count of bytes read 00050 QByteArray m_data; 00051 }; 00052 00053 #endif
1.5.5