MythTV master
ParseBinary.h
Go to the documentation of this file.
1/* ParseBinary.h
2
3 Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19
20*/
21
22
23#ifndef PARSEBIN_H
24#define PARSEBIN_H
25
26class MHOctetString;
27class MHGroup;
28
29#include "ParseNode.h"
30
32{
33 public:
34 explicit MHParseBinary(QByteArray &program)
35 : m_data(program) {}
36 ~MHParseBinary() override = default;
37
38 // Parse the binary and return a pointer to the parse tree
39 MHParseNode *Parse() override // MHParseBase
40 { return DoParse(); }
41
42 private:
44 unsigned char GetNextChar();
45 void ParseString(int endStr, MHOctetString &str);
46 int ParseInt(int endInt);
47
48 private:
49 int m_p {0}; // Count of bytes read
50 QByteArray m_data;
51};
52
53#endif
Definition: Groups.h:47
void ParseString(int endStr, MHOctetString &str)
Definition: ParseBinary.cpp:53
MHParseNode * DoParse()
int ParseInt(int endInt)
Definition: ParseBinary.cpp:80
QByteArray m_data
Definition: ParseBinary.h:50
MHParseNode * Parse() override
Definition: ParseBinary.h:39
unsigned char GetNextChar()
Definition: ParseBinary.cpp:41
MHParseBinary(QByteArray &program)
Definition: ParseBinary.h:34
~MHParseBinary() override=default