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