Class SieveScript.

Inherits SieveProduction

The SieveScript class models a single script. It contains commands, has errors, etc. It's used by the Sieve class to run scripts and and ManageSieveCommand to syntax-check them.

SieveScript::SieveScript()

Constructs an empty sieve script.

Reimplements Garbage::Garbage().

bool SieveScript::isEmpty() const

Returns true if this script contains no commands, and false otherwise.

EString SieveScript::location( uint position ) const

Returns a string describing the location of position in the current script.

void SieveScript::parse( const EString & script )

Parses script and stores the script as this object. Any previous script content is deleted. If script is has parse errors, they may be accessed as parseErrors().

EString SieveScript::parseErrors() const

Returns a (multi-line) string describing all the parse errors seen by the last call to parse(). If there are no errors, the returned string is empty. If there are any, it is a multiline string with CRLF after each line (except the last).

EString SieveScript::source() const

Returns a copy of the source code of this script.

List<SieveCommand> * SieveScript::topLevelCommands() const

Returns a list of top-level commands in this script. "if" and other commands may also have children.

Returns a null pointer if no script has been parsed, or a pointer to a (possiblty empty) list of commands if parse() has been called. The caller should not modify the list.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.