Stream for XML
[XiMoL Users]


Detailed Description

This module contains the user interface functions.


Files

file  control_flow.hpp
 control flow (declaration).


Functions

XIMOL_BEGIN_NAMESPACE XIMOL_EXPORT
bool 
has_skip_whitespace (xistream &xis)
 Test the flag to eat all white space.

XIMOL_EXPORT xistreamskip_whitespace (xistream &xis)
 Turn on the flag to eat all white space.

XIMOL_EXPORT xistreamno_skip_whitespace (xistream &xis)
 Turn off the flag to eat all white space.

XIMOL_EXPORT xistreamdrop_space (xistream &xis)
 Eat all white space.

XIMOL_EXPORT xistreamdrop_content (xistream &xis)
 Eat the content until the next end or start tag.

XIMOL_EXPORT bool is_stag (xistream &xis)
 Test next element.

XIMOL_EXPORT bool is_etag (xistream &xis)
 Test next element.

XIMOL_EXPORT xistreamdrop_next_element (xistream &xis)
 Drop next element This function drop the nest element if the stream is at a start tag.

XIMOL_EXPORT xistreamdrop_element_until_etag (xistream &xis)
 Drop next element a simple combinaison of function to control the flow.

template<typename String1, typename String2> bool wait_stag (xistream &xis, String1 ns, String2 tag)
 Wait for a pricise tag at this level.

template<typename String1> bool wait_stag (xistream &xis, String1 tag)
 Wait for a pricise tag at this level.


Function Documentation

XIMOL_EXPORT xistream& drop_content xistream xis  ) 
 

Eat the content until the next end or start tag.

Following the W3C definition:

[Definition: The text between the start-tag and end-tag is called the element's content:] [content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
This function is really usefull to drop the comment or wait a precise tag.

Parameters:
xis the stream
Returns:
the input stream

Definition at line 110 of file control_flow.cpp.

References char_data_content().

Referenced by drop_element_until_etag(), reader_policy::by_default< qname_type, abs_reader_type >::read(), and wait_stag().

XIMOL_EXPORT xistream& drop_element_until_etag xistream xis  ) 
 

Drop next element a simple combinaison of function to control the flow.

Here is the equivalent code

while (drop_content(xis) && is_stag(xis)) drop_next_element(xis);

Parameters:
xis the stream
Returns:
the input stream

Definition at line 181 of file control_flow.cpp.

References drop_content(), drop_next_element(), and is_stag().

Referenced by drop_next_element(), and reader_policy::by_default< qname_type, abs_reader_type >::read().

XIMOL_EXPORT xistream& drop_next_element xistream xis  ) 
 

Drop next element This function drop the nest element if the stream is at a start tag.

If an element is useless, then it is a good way to drop it.

Parameters:
xis the stream
Returns:
the input stream

Definition at line 161 of file control_flow.cpp.

References _(), drop_element_until_etag(), is_stag(), read_etag(), read_stag(), XIMOL_AS_ERROR, XIMOL_PARSER_USING_NAMESPACE, XIMOL_THROW, and xstring.

Referenced by drop_element_until_etag(), and wait_stag().

XIMOL_EXPORT xistream& drop_space xistream xis  ) 
 

Eat all white space.

Drop first white spaces in the stream. White space are defined by:

S ::= (x20 | x9 | xD | xA)

Parameters:
xis the stream
Returns:
the input stream

Definition at line 101 of file control_flow.cpp.

References read_optionnal_space(), and XIMOL_PARSER_USING_NAMESPACE.

XIMOL_BEGIN_NAMESPACE XIMOL_EXPORT bool has_skip_whitespace xistream xis  ) 
 

Test the flag to eat all white space.

Drop first white spaces in the stream before reading stag and etag

S ::= (x20 | x9 | xD | xA)

Parameters:
xis the stream
Returns:
the test result

Definition at line 75 of file control_flow.cpp.

Referenced by is_etag(), is_stag(), and operator>>().

XIMOL_EXPORT bool is_etag xistream xis  ) 
 

Test next element.

test if the incoming element is a start tag.

Parameters:
xis the stream
Returns:
the result of the test

Definition at line 140 of file control_flow.cpp.

References xistream::context, xistream::get(), has_skip_whitespace(), xistream::putback(), read_optionnal_space(), XCHAR_LESS_THAN_SIGN, XCHAR_SOLIDUS, xchar_t, and XIMOL_PARSER_USING_NAMESPACE.

XIMOL_EXPORT bool is_stag xistream xis  ) 
 

Test next element.

test if the incoming element is a start tag. This function could be use with the drop_content to do some loop.

while ((drop_content(xis) && (is_stag(xis)) ...;

Parameters:
xis the stream
Returns:
the result of the test

Definition at line 119 of file control_flow.cpp.

References xistream::context, xistream::get(), has_skip_whitespace(), is_letter(), xistream::putback(), read_optionnal_space(), XCHAR_LESS_THAN_SIGN, xchar_t, and XIMOL_PARSER_USING_NAMESPACE.

Referenced by drop_element_until_etag(), drop_next_element(), reader_policy::by_default< qname_type, abs_reader_type >::read(), and wait_stag().

XIMOL_EXPORT xistream& no_skip_whitespace xistream xis  ) 
 

Turn off the flag to eat all white space.

Drop first white spaces in the stream before reading stag and etag

S ::= (x20 | x9 | xD | xA)

Parameters:
xis the stream
Returns:
the input stream

Definition at line 92 of file control_flow.cpp.

XIMOL_EXPORT xistream& skip_whitespace xistream xis  ) 
 

Turn on the flag to eat all white space.

Drop first white spaces in the stream before reading stag and etag

S ::= (x20 | x9 | xD | xA)

Parameters:
xis the stream
Returns:
the input stream

Definition at line 83 of file control_flow.cpp.

template<typename String1>
bool wait_stag xistream xis,
String1  tag
 

Wait for a pricise tag at this level.

drop the content and elements until it find an end tag or the tag.

Parameters:
xis the stream
tag the tag
Returns:
true if the tag is found false if not.

Definition at line 260 of file control_flow.hpp.

References drop_content(), drop_next_element(), is_stag(), and xstring.

template<typename String1, typename String2>
bool wait_stag xistream xis,
String1  ns,
String2  tag
 

Wait for a pricise tag at this level.

drop the content and elements until it find an end tag or the tag.

Parameters:
xis the stream
ns the namespace
tag the tag
Returns:
true if the tag is found false if not.

Definition at line 231 of file control_flow.hpp.

References xistream::context, drop_content(), drop_next_element(), is_stag(), and xstring.



Donate to the XiMoL project SourceForge.net Logo If you have any questions about XiMoL, you could write to tournois@users.sourceforge.net.