]> git.ipfire.org Git - thirdparty/squid.git/blame - src/esi/CustomParser.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / esi / CustomParser.h
CommitLineData
43ae1d95 1/*
bde978a6 2 * Copyright (C) 1996-2015 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 */
bbc27441 8
43ae1d95 9#ifndef SQUID_ESICUSTOMPARSER_H
10#define SQUID_ESICUSTOMPARSER_H
11
e1f7507e
AJ
12class Trie;
13
14/* inherits from */
f99c2cfe 15#include "esi/Parser.h"
43ae1d95 16
e1f7507e
AJ
17/* for String variables */
18#include "SquidString.h"
43ae1d95 19
e1f7507e
AJ
20/**
21 \ingroup ESIAPI
22 */
43ae1d95 23class ESICustomParser : public ESIParser
24{
25
26public:
43ae1d95 27 ESICustomParser(ESIParserClient *);
28 ~ESICustomParser();
29 /* true on success */
30 bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream);
137a13ea 31 long int lineNumber() const;
43ae1d95 32 char const * errorString() const;
33
019db3c6
AR
34 EsiParserDeclaration;
35
43ae1d95 36private:
37 static Trie *SearchTrie;
43ae1d95 38 static Trie *GetTrie();
39 enum ESITAG_t {
40 ESITAG=1,
41 ESIENDTAG=2,
1ca66937 42 ESICOMMENT=3
43ae1d95 43 };
44
45 char const *findTag(char const *a, size_t b);
46 ESIParserClient *theClient;
30abd221 47 String error;
43ae1d95 48 /* cheap n dirty - buffer it all */
30abd221 49 String content;
43ae1d95 50 /* TODO: make a class of this type code */
51 ESITAG_t lastTag;
52};
53
54#endif /* SQUID_ESICUSTOMPARSER_H */
f53969cc 55