2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 86 ESI processing */
11 #ifndef SQUID_SRC_ESI_ASSIGN_H
12 #define SQUID_SRC_ESI_ASSIGN_H
14 #include "esi/Element.h"
15 #include "esi/VarState.h"
16 #include "SquidString.h"
18 /** This is a variable that is itself an expression */
19 class ESIVariableExpression
: public ESIVarState::Variable
22 ~ESIVariableExpression() override
;
23 ESIVariableExpression (String
const &value
);
24 void eval (ESIVarState
&state
, char const *, char const *) const override
;
32 class ESIAssign
: public ESIElement
34 MEMPROXY_CLASS(ESIAssign
);
37 ESIAssign (esiTreeParentPtr
, int, const char **, ESIContext
*);
38 ESIAssign (ESIAssign
const &);
39 ESIAssign
&operator=(ESIAssign
const &);
40 ~ESIAssign() override
;
41 esiProcessResult_t
process (int dovars
) override
;
42 void render(ESISegment::Pointer
) override
;
43 bool addElement(ESIElement::Pointer
) override
;
44 void provideData (ESISegment::Pointer data
, ESIElement
* source
) override
;
45 Pointer
makeCacheable() const override
;
46 Pointer
makeUsable(esiTreeParentPtr
, ESIVarState
&) const override
;
47 void finish() override
;
50 void evaluateVariable();
51 esiTreeParentPtr parent
;
52 ESIVarState
*varState
;
54 ESIVariableExpression
* value
;
55 ESIElement::Pointer variable
;
56 String unevaluatedVariable
;
59 #endif /* SQUID_SRC_ESI_ASSIGN_H */