CScriptparser Class Reference

class for parsing simple scriptfiles More...

#include <cscriptparser.h>

List of all members.

Public Member Functions

 CScriptparser (const std::string &scriptfile)
 Default ctor.
 ~CScriptparser ()
 Default dtor.
void parse ()
 Start parsing the scriptfile.

Protected Member Functions

void callFunc (const std::string &func, const std::list< std::string > &funcparams)
 Delegates the function and its parameters to the correct method (internal or handler).
void read (std::list< std::string > funcparams)
 Handles/wrappes read-command. according to the filetype the read-method of the corresponding handler will be called inside.
void write (std::list< std::string > funcparams)
 Handles/wrappes write-command. according to the filetype the write-method of the corresponding handler will be called inside.

Classes

class  ParserError
 Exception thrown by CScriptparser. More...


Detailed Description

class for parsing simple scriptfiles

Modulname:
cscriptparser
Author:
Guenther Neuwirth (0626638), Manuel Mausz (0728348)
Date:
17.04.2009
Parses a simple line based scriptfile with some limitations: first function (starting a block) must be a read-command, last must be a write-command (ending this block).

read- and write-commands have hard coded parameters, number#1 being a filetype. Classes handling certain filetypes must be of type CFile. Custom functions will be passed to CFile::callFunc().

On error ParserError will be thrown.


Constructor & Destructor Documentation

CScriptparser::CScriptparser ( const std::string &  scriptfile  ) 

Default ctor.

Methodname:
CScriptparser
Parameters:
scriptfile filename of script to parse
Returns:
-
Global variables used:
none
Exceptions:
bad_alloc 
Conditions:
none

CScriptparser::~CScriptparser (  ) 

Default dtor.

Methodname:
~CScriptparser
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none


Member Function Documentation

void CScriptparser::parse (  ) 

Start parsing the scriptfile.

Methodname:
parse
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
ParserError 
Conditions:
none

void CScriptparser::callFunc ( const std::string &  func,
const std::list< std::string > &  funcparams 
) [protected]

Delegates the function and its parameters to the correct method (internal or handler).

Methodname:
callFunc
Parameters:
func function name
funcparams function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
ParserError 
Conditions:
none

void CScriptparser::read ( std::list< std::string >  funcparams  )  [protected]

Handles/wrappes read-command. according to the filetype the read-method of the corresponding handler will be called inside.

Methodname:
read
Parameters:
funcparams function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
ParserError 
Conditions:
none
Scriptfile syntax: read(<FILETYPE>, <FILENAME>)

void CScriptparser::write ( std::list< std::string >  funcparams  )  [protected]

Handles/wrappes write-command. according to the filetype the write-method of the corresponding handler will be called inside.

Methodname:
write
Parameters:
funcparams function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
ParserError 
Conditions:
none
Scriptfile syntax: write(<FILETYPE>, <FILENAME>)


The documentation for this class was generated from the following files:
Generated on Sun May 3 19:16:26 2009 for imgsynth2 by  doxygen 1.5.3