CoreUtils/Parser.h
2025-12-16 16:51:44 -08:00

36 lines
794 B
C++

#ifndef __Parser_h__
#define __Parser_h__
#include <fstream>
#include <vector>
namespace coreutils {
///
/// Use the StreamReader to read data from a socket and buffer it for use by
/// various stream parsers such as IMFMessage. The reader maintains data
/// consistency regardless of the packet delivery for the stream.
///
class Parser {
public:
Parser(StreamReader &reader, Parser *parser);
virtual ~Parser();
int doParse(); <--- copy the buffer available in read to here and call parse();
bool checkParse(Parser &parser); <--- can be called in parse to see if the parsing should branch
virtual int parse();
private:
MString buffer;
Parser *parser;
vector<Parser *> chain;
};
}
#endif