]> git.ipfire.org Git - thirdparty/squid.git/blob - src/esi/Assign.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / esi / Assign.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 /* DEBUG: section 86 ESI processing */
10
11 #ifndef SQUID_ESIASSIGN_H
12 #define SQUID_ESIASSIGN_H
13
14 #include "esi/Element.h"
15 #include "esi/VarState.h"
16 #include "SquidString.h"
17
18 /* ESIVariableExpression */
19 /* This is a variable that is itself and expression */
20
21 class ESIVariableExpression : public ESIVarState::Variable
22 {
23
24 public:
25 ~ESIVariableExpression();
26 ESIVariableExpression (String const &value);
27 virtual void eval (ESIVarState &state, char const *, char const *) const;
28
29 private:
30 String expression;
31 };
32
33 /* ESIAssign */
34
35 class ESIContext;
36
37 class ESIAssign : public ESIElement
38 {
39
40 public:
41 MEMPROXY_CLASS(ESIAssign);
42 ESIAssign (esiTreeParentPtr, int, const char **, ESIContext *);
43 ESIAssign (ESIAssign const &);
44 ESIAssign &operator=(ESIAssign const &);
45 ~ESIAssign();
46 esiProcessResult_t process (int dovars);
47 void render(ESISegment::Pointer);
48 bool addElement(ESIElement::Pointer);
49 void provideData (ESISegment::Pointer data, ESIElement * source);
50 Pointer makeCacheable() const;
51 Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const;
52 void finish();
53
54 private:
55 void evaluateVariable();
56 esiTreeParentPtr parent;
57 ESIVarState *varState;
58 String name;
59 ESIVariableExpression * value;
60 ESIElement::Pointer variable;
61 String unevaluatedVariable;
62 };
63
64 MEMPROXY_CLASS_INLINE(ESIAssign);
65
66 #endif /* SQUID_ESIASSIGN_H */