WeTagScanner Class Reference

TAG scanner for parsing markup languages (XML or HTML). More...

#include <weTagScanner.h>

List of all members.

Public Member Functions

 WeTagScanner (WeInStream &is)
 Constructor.
virtual ~WeTagScanner ()
WeScannerToken GetToken ()
 Gets the next token from stream.
const char * GetValue ()
 Gets the value.
const char * GetAttrName ()
 Gets the attribute name.
const char * GetTagName ()
 Gets the tag name.
virtual char ResolveEntity (const char *buf, int buf_size)
 Resolve entity.
virtual int GetPos ()

Private Types

typedef WeScannerToken(WeTagScanner::* fnScan )()
 WebEngine scanner token parser function.

Private Member Functions

WeScannerToken ScanBody ()
 Scans the body.
WeScannerToken ScanHead ()
 Scans the head.
WeScannerToken ScanComment ()
 Scans the comment.
WeScannerToken ScanCdata ()
 Scans the cdata.
WeScannerToken ScanPi ()
 Scans the PHP includes.
WeScannerToken ScanTag ()
 Scans the tag.
WeScannerToken ScanEntityDecl ()
 Scans the cdata.
char SkipWhitespace ()
 Skip whitespaces.
void PushBack (char c)
 Pushes the given character back to the stream.
char GetChar ()
 Gets the char from the input stream.
char ScanEntity ()
 Scans the entity (&-based encoding).
bool IsWhitespace (char c)
 Query if 'c' is whitespace.
void AppendValue (char c)
 Appends a value.
void AppendAttrName (char c)
 Appends an attribute name.
void AppendTagName (char c)
 Appends a tag name.

Private Attributes

fnScan c_scan

Static Private Attributes

static const int MAX_TOKEN_SIZE = 1024
static const int MAX_NAME_SIZE = 128


Detailed Description

TAG scanner for parsing markup languages (XML or HTML).

This class implements operations to parsing the input stream for tag-based markup (i.e. HTML).

Author:
Aabramov
Date:
26.05.2009
Examples:

tagscanner.cpp.

Definition at line 112 of file weTagScanner.h.


Member Typedef Documentation

WeScannerToken(WeTagScanner::* WeTagScanner::fnScan)() [private]

WebEngine scanner token parser function.

This type defines pointer to the scanner function. Used to switch scanner function to parse different regions of the source file.


Constructor & Destructor Documentation

WeTagScanner::WeTagScanner ( WeInStream is  )  [inline]

Constructor.

Parameters:
is - the input stream to parse.

Definition at line 120 of file weTagScanner.h.

virtual WeTagScanner::~WeTagScanner (  )  [inline, virtual]

Definition at line 127 of file weTagScanner.h.


Member Function Documentation

void WeTagScanner::AppendAttrName ( char  c  )  [private]

Appends an attribute name.

Parameters:
c - The char to append to the attribute name.

Definition at line 508 of file weTagScanner.cpp.

void WeTagScanner::AppendTagName ( char  c  )  [private]

Appends a tag name.

Parameters:
c - The char to append to the tag name.

Definition at line 519 of file weTagScanner.cpp.

void WeTagScanner::AppendValue ( char  c  )  [private]

Appends a value.

Parameters:
c - The char to append to the value.

Definition at line 495 of file weTagScanner.cpp.

const char * WeTagScanner::GetAttrName ( void   ) 

Gets the attribute name.

Return values:
null if it fails, else the attribute name.
Examples:
tagscanner.cpp.

Definition at line 62 of file weTagScanner.cpp.

char WeTagScanner::GetChar (  )  [private]

Gets the char from the input stream.

Returns:
The next input char.

Definition at line 471 of file weTagScanner.cpp.

virtual int WeTagScanner::GetPos (  )  [inline, virtual]

Definition at line 150 of file weTagScanner.h.

const char * WeTagScanner::GetTagName ( void   ) 

Gets the tag name.

Return values:
null if it fails, else the tag name.
Examples:
tagscanner.cpp.

Definition at line 74 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::GetToken (  )  [inline]

Gets the next token from stream.

Returns:
The token.
Examples:
tagscanner.cpp.

Definition at line 135 of file weTagScanner.h.

const char * WeTagScanner::GetValue ( void   ) 

Gets the value.

Return values:
null if it fails, else the value.
Examples:
tagscanner.cpp.

Definition at line 50 of file weTagScanner.cpp.

bool WeTagScanner::IsWhitespace ( char  c  )  [private]

Query if 'c' is whitespace.

Parameters:
c - The input character.
Return values:
true if whitespace, false if not.

Definition at line 483 of file weTagScanner.cpp.

void WeTagScanner::PushBack ( char  c  )  [private]

Pushes the given character back to the stream.

Parameters:
c - The character to be returned to the stream.

Definition at line 460 of file weTagScanner.cpp.

wchar_t WeTagScanner::ResolveEntity ( const char *  buf,
int  buf_size 
) [inline, virtual]

Resolve entity.

Parameters:
buf - If non-null, the buffer.
buf_size - Size of the buffer.
Returns:
resulting char.

Definition at line 149 of file weTagScanner.h.

WeScannerToken WeTagScanner::ScanBody ( void   )  [private]

Scans the body.

Returns:
current token.

Definition at line 86 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanCdata (  )  [private]

Scans the cdata.

Returns:
current token.

Definition at line 229 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanComment ( void   )  [private]

Scans the comment.

Returns:
current token.

Definition at line 193 of file weTagScanner.cpp.

char WeTagScanner::ScanEntity (  )  [private]

Scans the entity (&-based encoding).

Returns:
resulting character.

Definition at line 352 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanEntityDecl (  )  [private]

Scans the cdata.

Return values:
current token.

Definition at line 414 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanHead ( void   )  [private]

Scans the head.

Returns:
current token.

Definition at line 125 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanPi (  )  [private]

Scans the PHP includes.

Returns:
current token.

Definition at line 266 of file weTagScanner.cpp.

WeScannerToken WeTagScanner::ScanTag (  )  [private]

Scans the tag.

Returns:
current token.

Definition at line 301 of file weTagScanner.cpp.

char WeTagScanner::SkipWhitespace (  )  [private]

Skip whitespaces.

Returns:
first non-whitespace char

Definition at line 445 of file weTagScanner.cpp.


Member Data Documentation

Definition at line 167 of file weTagScanner.h.

const int WeTagScanner::MAX_NAME_SIZE = 128 [static, private]

Definition at line 155 of file weTagScanner.h.

const int WeTagScanner::MAX_TOKEN_SIZE = 1024 [static, private]

Definition at line 154 of file weTagScanner.h.


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


 
©2009 Positive Technologies
 
Generated on Tue Jul 14 18:27:32 2009 for WebEngine by 
 
 
1.5.7
 
Get wpcObj at SourceForge.net. Fast, secure and Free Open Source software downloads