Class SieveArgumentList.

Inherits SieveProduction

The SieveArgumentList class models the arguments production.

void SieveArgumentList::allowOneTag( const char * t1, const char * t2, const char * t3, const char * t4, const char * t5 )

Asserts that at most one of t1, t2, t3, t4 and t5 occur. t1 and t2 must be supplied, the rest are optional.

void SieveArgumentList::append( SieveArgument * a )

Appands a to the list of arguments() kept by this object. Does nothing if a is 0.

void SieveArgumentList::append( SieveTest * t )

Appands t to the list of tests() kept by this object. Does nothing if t is 0.

SieveArgument * SieveArgumentList::argumentFollowingTag( const EString & tag )

Makes sure that tag occurs either zero or one times in the argument list, and returns the following argument. Records an error if tag occurs more than once or occurs as the last argument.

Returns a null pointer if tag doesn't occur or occurs as the last argument. e

List<SieveArgument> * SieveArgumentList::arguments() const

Returns a pointer to this object's list of SieveArgument objects. The returned list may be empty, but the pointer is never 0.

SieveArgument * SieveArgumentList::findTag( const EString & tag ) const

Finds the argument tagged tag and returns a pointer to it. If tag ocurs more than once, all occurences are flagged as bad and the first occurence returned.

Returns a null pointer if tag does not occur anywhere.

Marks the returned argument as parsed.

void SieveArgumentList::flagUnparsedAsBad()

Mark all unparsed arguments as errors. We haven't looked at them, so something must be wrong.

void SieveArgumentList::numberRemainingArguments()

Assign numbers to each of the remaining arguments. The first argument has number 1. Each argument can be accessed using takeStringList(), takeString() and takeNumber().

This function does not mark the arguments as parsed.

void SieveArgumentList::tagError( const char * tag, const EString & error )

Records error, either on this node or on the argument tagged tag.

SieveArgument * SieveArgumentList::takeArgument( uint n )

Returns a pointer to numbered argument number n. The first argument is numbered 1. Returns a null pointer if there isn't any such argument.

This function doesn't call SieveArgument::setParsed() or check any error at all.

uint SieveArgumentList::takeNumber( uint n )

Looks for argument n, asserts that it is a number, and returns the number (or 0 in the case of error). n is 1 for the first argument.

UString SieveArgumentList::takeString( uint n )

Looks for argument n, asserts that it is a string, and returns the string (or en empty string). n is 1 for the first argument.

UStringList * SieveArgumentList::takeStringList( uint n )

Looks for argument n, asserts that it is a string list, and returns a pointer to the string list (or a null pointer). n is 1 for the first argument.

uint SieveArgumentList::takeTaggedNumber( const EString & tag )

Looks for the tag and returns the value of the following number. Records an error if anything looks wrong.

If tag doesn't occur, takeTaggedNumber() returns 0.

Marks both arguments as parsed.

UString SieveArgumentList::takeTaggedString( const EString & tag )

Looks for the tag and returns the value of the following string. Records an error if anything looks wrong.

If tag doesn't occur, takeTaggedString() returns an empty string.

Marks both arguments as parsed.

UStringList * SieveArgumentList::takeTaggedStringList( const EString & tag )

Looks for the tag and returns the value of the following string list. Records an error if anything looks wrong.

If tag doesn't occur, takeTaggedStringList() returns a null pointer.

Marks both arguments as parsed.

List<SieveTest> * SieveArgumentList::tests() const

Returns a pointer to this object's list of SieveTest objects. The returned list may be empty, but the pointer is never 0.

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