Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

policy_strict_stream Class Reference

#include <xml_stream_policy.h>

Inheritance diagram for policy_strict_stream:

Inheritance graph
[legend]
List of all members.

Detailed Description

CTTL policy class for CTTL XML stream parser sample.

This policy class keeps track of the state of xml input file at run time. policy_strict_stream ignores white space. No white space is recognized or skipped by this class.

Definition at line 43 of file xml_stream_policy.h.

Public Member Functions

 policy_strict_stream (edge<> &consumed_data_)
 Constructs and does basic initialization of the policy object.
void operator= (policy_strict_stream const &) const
 Assignment does nothing.
bool init (char *file_)
 Initializes the object: opens the input file.
template<typename UniverseT>
size_t match (UniverseT &universe_)
 Defines CTTL production rule function to evaluate grammar describing white space.

Protected Attributes

char line_buffer [max_buffer_size]
 Character buffer for reading the data.
FILE * file_stream
 Pointer to an open input file.
edge & consumed_data
 Substring of input that has already been fully processed by the parser, and can be safely discarded from the input text to free up the memory.


Constructor & Destructor Documentation

policy_strict_stream edge<> &  consumed_data_  )  [inline]
 

Constructs and does basic initialization of the policy object.

Definition at line 74 of file xml_stream_policy.h.

References consumed_data, and file_stream.


Member Function Documentation

bool init char *  file_  )  [inline]
 

Initializes the object: opens the input file.

Returns:
The function returns true if the input file has been opened for reading successfully, false otherwise.

Definition at line 94 of file xml_stream_policy.h.

References file_stream.

size_t match UniverseT &  universe_  )  [inline]
 

Defines CTTL production rule function to evaluate grammar describing white space.

UniverseT
Template parameter specifying type of the parseable universe. Mutable universe, cttl::edge, is expected.
Parameters:
universe_ Reference to the parseable universe.
Returns:
Absolute position of the universe upper boundary after white space expression has been evaluated.
Postcondition:
This function always succeeds and returns a valid offset within the specified universe of discourse. The function may choose to read more information from the input file, if available. If end of file is reached, the function closes the input file and updates state of the policy object accordingly. Additionally, before data is loaded from the file, the substring of input specified by the consumed_data substring is discarded, so that the memory used by the parser is freed.

Reimplemented in policy_relaxed_stream.

Definition at line 127 of file xml_stream_policy.h.

References consumed_data, file_stream, and line_buffer.

void operator= policy_strict_stream const &   )  const [inline]
 

Assignment does nothing.

Definition at line 82 of file xml_stream_policy.h.


Member Data Documentation

edge& consumed_data [protected]
 

Substring of input that has already been fully processed by the parser, and can be safely discarded from the input text to free up the memory.

Definition at line 70 of file xml_stream_policy.h.

Referenced by match(), and policy_strict_stream().

FILE* file_stream [protected]
 

Pointer to an open input file.

A null pointer value indicates that the file has been already closed, and no more input is available.

Definition at line 64 of file xml_stream_policy.h.

Referenced by init(), match(), and policy_strict_stream().

char line_buffer[max_buffer_size] [protected]
 

Character buffer for reading the data.

Definition at line 57 of file xml_stream_policy.h.

Referenced by match().


The documentation for this class was generated from the following file:
Generated on Thu Nov 2 17:43:34 2006 for CTTL XML stream parser sample by  doxygen 1.3.9.1