#include <buffer.h>
Public Member Functions | |
Buffer (ProjectionDFA *_pdfa) | |
Constructor. | |
virtual | ~Buffer () |
void | appendTag (TAG tag) |
Appends a tag node to the buffer. | |
void | appendTag (TAG tag, vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles) |
Appends a tag node including roles to the buffer. | |
void | appendPCData (const char *data) |
Appends a text node to the buffer. | |
void | appendPCData (const char *data, vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles) |
Appends a text node including some roles to the buffer. | |
void | appendRoles (vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles) |
Appends a set of roles to the current buffer node. | |
void | print (OutputStream &dos) |
Prints the buffer. | |
void | printCurrent (OutputStream &dos) |
Prints the current node of the buffer (including its subtree). | |
void | debugPrint (OutputStream &dos) |
Prints the buffer including debug and role information. | |
BufferNode * | getRoot () |
Returns the document root. | |
BufferNode * | getCurrent () |
Returns the current buffer node. | |
void | closeTag () |
Closes the current tag node in the buffer. | |
Private Attributes | |
BufferNode * | root |
The root node of the buffer. | |
BufferNode * | cur |
The current node of the buffer. |
The buffer is implemented as a DOM tree. The buffer may contain both tag and character nodes, and the class provides methods for appending suchlike node types.
Definition at line 51 of file buffer.h.
Buffer::Buffer | ( | ProjectionDFA * | _pdfa | ) |
Constructor.
Constructor - creating object for a ProjectionDFA.
[in] | _pdfa | The ProjectionDFA is used to assign the roles to the document root. |
Definition at line 37 of file buffer.cpp.
References appendRoles(), cur, ProjectionDFAState::getCumulativeRoles(), ProjectionDFA::getInitialState(), ProjectionDFAState::getNonCumulativeRoles(), root, and TAGID_ROOT.
Buffer::~Buffer | ( | ) | [virtual] |
void Buffer::appendPCData | ( | const char * | data, | |
vector< unsigned > * | _cumulative_roles, | |||
vector< unsigned > * | _non_cumulative_roles | |||
) |
Appends a text node including some roles to the buffer.
The text node is appended at the current position of the buffer.
[in] | data | The PCDATA content of the node that will be created. |
[in] | _cumulative_roles | Pointer to a vector containing cumulative roles. |
[in] | _non_cumulative_roles | Pointer to a vector containing non-cumulative roles. |
void |
Definition at line 71 of file buffer.cpp.
References BufferNode::addChild(), and cur.
void Buffer::appendPCData | ( | const char * | data | ) |
Appends a text node to the buffer.
The text node is appended at the current position of the buffer.
[in] | data | The PCDATA content of the node that will be created. |
void |
Definition at line 65 of file buffer.cpp.
References BufferNode::addChild(), and cur.
Referenced by StreamTracker::processPCData().
void Buffer::appendRoles | ( | vector< unsigned > * | _cumulative_roles, | |
vector< unsigned > * | _non_cumulative_roles | |||
) |
Appends a set of roles to the current buffer node.
[in] | _cumulative_roles | Pointer to a vector containing cumulative roles. |
[in] | _non_cumulative_roles | Pointer to a vector containing non-cumulative roles. |
void |
Definition at line 79 of file buffer.cpp.
References BufferNode::appendRoles(), and cur.
Referenced by Buffer().
void Buffer::appendTag | ( | TAG | tag, | |
vector< unsigned > * | _cumulative_roles, | |||
vector< unsigned > * | _non_cumulative_roles | |||
) |
Appends a tag node including roles to the buffer.
The tag node is appended at the current position of the buffer.
[in] | tag | The tag id of the node that will be created. |
[in] | _cumulative_roles | Pointer to a vector containing cumulative roles. |
[in] | _non_cumulative_roles | Pointer to a vector containing non-cumulative roles. |
void |
Definition at line 57 of file buffer.cpp.
References BufferNode::addChild(), and cur.
void Buffer::appendTag | ( | TAG | tag | ) |
Appends a tag node to the buffer.
The tag node is appended at the current position of the buffer.
[in] | tag | The tag id of the node that will be created. |
void |
Definition at line 50 of file buffer.cpp.
References BufferNode::addChild(), and cur.
Referenced by StreamTracker::processBachelorTag(), and StreamTracker::processOpeningTag().
void Buffer::closeTag | ( | ) |
Closes the current tag node in the buffer.
This is simply realized by marking the tag node as closed.
void |
Definition at line 96 of file buffer.cpp.
References BufferNode::close(), cur, and BufferNode::parent.
Referenced by StreamTracker::processBachelorTag(), and StreamTracker::processClosingTag().
void Buffer::debugPrint | ( | OutputStream & | dos | ) |
Prints the buffer including debug and role information.
Prints the complete buffer to the debug output stream, including idebug and role information.
[in] | dos | Reference to the (debug) OutputStream. |
void |
Definition at line 92 of file buffer.cpp.
References BufferNode::debugPrint(), and root.
Referenced by Executor::finalDebugPrint(), Executor::initStreamParser(), and Executor::preprocessStream().
BufferNode * Buffer::getCurrent | ( | ) | [inline] |
Returns the current buffer node.
Returns the current buffer node, i.e. the one that has last recently been read into the buffer.
BufferNode* | Pointer to the current BufferNode. |
BufferNode * Buffer::getRoot | ( | ) | [inline] |
Returns the document root.
The document root is the virtual root node of the XML document.
BufferNode* | Pointer to the document root. |
Definition at line 143 of file buffer.h.
References root.
Referenced by Executor::evalQuery().
void Buffer::print | ( | OutputStream & | dos | ) |
Prints the buffer.
Prints the complete buffer content to the debug output stream.
[in] | dos | Reference to the (debug) OutputStream. |
void |
Definition at line 84 of file buffer.cpp.
References BufferNode::print(), and root.
Referenced by Executor::preprocessStream().
void Buffer::printCurrent | ( | OutputStream & | dos | ) |
Prints the current node of the buffer (including its subtree).
Prints the node that is currently active to the debug output stream, including its subtree.
[in] | dos | Reference to the (debug) OutputStream. |
void |
Definition at line 88 of file buffer.cpp.
References cur, and BufferNode::print().
BufferNode * Buffer::cur [private] |
The current node of the buffer.
The current node of the buffer, i.e. the node that has been appended or closed last recently.
Definition at line 174 of file buffer.h.
Referenced by appendPCData(), appendRoles(), appendTag(), Buffer(), closeTag(), and printCurrent().
BufferNode * Buffer::root [private] |