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 class MHOctetString; 00027 class MHGroup; 00028 00029 #include "ParseNode.h" 00030 00031 class MHParseBinary: public MHParseBase 00032 { 00033 public: 00034 MHParseBinary(QByteArray &program); 00035 virtual ~MHParseBinary() {} 00036 00037 // Parse the binary and return a pointer to the parse tree 00038 virtual MHParseNode *Parse() { return DoParse(); } 00039 00040 private: 00041 MHParseNode *DoParse(); 00042 unsigned char GetNextChar(); 00043 void ParseString(int endStr, MHOctetString &str); 00044 int ParseInt(int endInt); 00045 00046 private: 00047 int m_p; // Count of bytes read 00048 QByteArray m_data; 00049 }; 00050 00051 #endif
1.6.3