]> git.ipfire.org Git - thirdparty/squid.git/blame - src/esi/ExpatParser.h
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / esi / ExpatParser.h
CommitLineData
43ae1d95 1/*
5b74111a 2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
43ae1d95 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
43ae1d95 7 */
8
9#ifndef SQUID_ESIEXPATPARSER_H
10#define SQUID_ESIEXPATPARSER_H
11
95cd9022 12#if USE_SQUID_ESI && HAVE_LIBEXPAT
8d18bed7 13
f99c2cfe 14#include "esi/Parser.h"
95cd9022
AJ
15
16#if HAVE_EXPAT_H
019db3c6 17#include <expat.h>
95cd9022 18#endif
43ae1d95 19
20class ESIExpatParser : public ESIParser
21{
22
23public:
43ae1d95 24 ESIExpatParser(ESIParserClient *);
25 ~ESIExpatParser();
63be0a78 26
f53969cc 27 /** \retval true on success */
43ae1d95 28 bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream);
63be0a78 29
137a13ea 30 long int lineNumber() const;
43ae1d95 31 char const * errorString() const;
32
019db3c6
AR
33 EsiParserDeclaration;
34
43ae1d95 35private:
63be0a78 36 /** our parser */
37 mutable XML_Parser p;
38 static void Start(void *data, const XML_Char *el, const char **attr);
39 static void End(void *data, const XML_Char *el);
40 static void Default (void *data, const XML_Char *s, int len);
41 static void Comment (void *data, const XML_Char *s);
43ae1d95 42 XML_Parser &myParser() const {return p;}
43
44 ESIParserClient *theClient;
45};
46
8d18bed7
AJ
47#endif /* USE_SQUID_ESI */
48
43ae1d95 49#endif /* SQUID_ESIEXPATPARSER_H */
f53969cc 50