CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

csp::tags::SwitchTag Class Reference

Inheritance diagram for csp::tags::SwitchTag:
Collaboration diagram for csp::tags::SwitchTag:

List of all members.


Classes

struct  condition

Public Member Functions

 SwitchTag (const string &name)
virtual void doStartTag (const attribs_t &attribs)
virtual void doEndTag ()
virtual void initChildBuffers ()

Private Member Functions

void doTopEndTag ()
void doChildEndTag ()

Private Attributes

stringstream m_my_body
string m_test
list< conditionm_conditions
conditionm_my_condition

Detailed Description

Tag synopsys <csp:switch test="int expr"> <csp:case value="[int]" [fallthrough="true"]>...</csp:case> <csp:default>...</csp:default> </csp:switch>
Parameters:
test Expression whose result to test.
value integer or enum value
fallthrough true or false. If true, no break will be generated at the end of case statement This tag generates switch statement construct. Currently only minimal checking is done to ensure no invalid constructs are present

Definition at line 175 of file ConditionalTags.cpp.


Constructor & Destructor Documentation

csp::tags::SwitchTag::SwitchTag ( const string &  name  )  [inline]

Definition at line 190 of file ConditionalTags.cpp.


Member Function Documentation

void csp::tags::SwitchTag::doChildEndTag (  )  [private]

void csp::tags::SwitchTag::doEndTag (  )  [virtual]

Called when closing tag is encountered

Implements servlet::taglib::Generator.

Definition at line 232 of file ConditionalTags.cpp.

References doChildEndTag(), doTopEndTag(), and servlet::taglib::Generator::getName().

Here is the call graph for this function:

virtual void csp::tags::SwitchTag::doStartTag ( const attribs_t attribs  )  [virtual]

doStartTag is called when opening tag is encountered

Parameters:
attribs key-value map of the tag attributes Override this function in your tag handler to generate pre-amble code for your tag

Implements servlet::taglib::Generator.

void csp::tags::SwitchTag::doTopEndTag (  )  [private]

FIXME: provide some checking for <csp:switch> body

Definition at line 243 of file ConditionalTags.cpp.

References servlet::taglib::Generator::body, m_conditions, and m_test.

Referenced by doEndTag().

void csp::tags::SwitchTag::initChildBuffers (  )  [virtual]

Sets up child buffers (buffers where contents _inside_ this tag is sent By default it's same as its own buffers (set by setBuffers) If this function is overridden and different set of buffers is generated, it's tag writer's responsibility to ensure that output is actually sent to parent's buffers

Reimplemented from servlet::taglib::Generator.

Definition at line 202 of file ConditionalTags.cpp.

References csp::tags::SwitchTag::SwitchTag::condition::fallthrough, servlet::taglib::Generator::getName(), servlet::taglib::Generator::m_child_body, m_conditions, m_my_body, m_my_condition, csp::tags::SwitchTag::SwitchTag::condition::name, and servlet::taglib::Generator::parent.

Here is the call graph for this function:


Member Data Documentation

Definition at line 187 of file ConditionalTags.cpp.

Referenced by doTopEndTag(), and initChildBuffers().

stringstream csp::tags::SwitchTag::m_my_body [private]

Definition at line 178 of file ConditionalTags.cpp.

Referenced by doChildEndTag(), and initChildBuffers().

string csp::tags::SwitchTag::m_test [private]

Definition at line 179 of file ConditionalTags.cpp.

Referenced by doTopEndTag().


The documentation for this class was generated from the following file:

SourceForge.net Logo