Class SieveTest.

Inherits SieveProduction

The SieveTest class models the RFC 5228 "test" production.

AddressPart SieveTest::addressPart() const

Returns the address part specified, or NoAddressPart if none has been expiclitly specified.

SieveArgumentList * SieveTest::arguments() const

Returns what setArguments() set, or a null pointer if setArguments() has not been called.

BodyMatchType SieveTest::bodyMatchType() const

Returns the body match type for this test, or Text for the default. The result is meaningful only when identifier() is "body".

Collation * SieveTest::comparator() const

Returns the comparator specified, or SieveTest::IAsciiCasemap if none has been.

UStringList * SieveTest::contentTypes() const

Returns a pointer to a list of the content types to be used for the "body" test, assuming that bodyMatchType() returns SpecifiedTypes. May return a null pointer.

UString SieveTest::datePart() const

Returns the specified date part if identifier() is "date" or "currentdate", and an empty string otherwise.

UString SieveTest::dateZone() const

Returns the specified zone in "[+-]NNNN" format if identifier() is "date" or "currentdate", and "-0000" if :originalzone was specified instead. Returns an empty string for other identifier()s.

UStringList * SieveTest::envelopeParts() const

Returns a list of the envelope parts the test "envelope" should look at, or a null pointer if identifier() is not "envelope".

void SieveTest::findAddressPart()

Finds the address-part tags and reacts sensibly.

void SieveTest::findComparator()

Finds any specified comparator name and sets the comparator accordingly.

void SieveTest::findMatchType()

Finds the match-type tags and reacts sensibly.

UStringList * SieveTest::headers() const

Returns a list of the headers to which the identifier() pertains, or a null pointer if the identifier() is of a type that doesn't use any header fields.

Each string in the list is header-cased (see EString::headerCased()).

EString SieveTest::identifier() const

Returns what setIdentifier() set, or an empty string if setIdentifier() has not been called.

UStringList * SieveTest::keys() const

Returns a list of the keys to be searched for, or a null pointer if none are known (which is the case e.g. if identifier() is "exists" or "true").

MatchOperator SieveTest::matchOperator() const

Returns the match operator specified, or is None if the match type is not Value or Count.

MatchType SieveTest::matchType() const

Returns the match type specified, or Is if none has been explicitly specified.

void SieveTest::parse()

Does semantic analysis and second-level parsing of sieve tests. Checks that the test is supported, etc.

void SieveTest::setArguments( SieveArgumentList * l )

Notifies this command that l is a list of its arguments. Does nothing if l is a null pointer.

void SieveTest::setIdentifier( const EString & i )

Notifies this command that its identifier if i. The initial value is an empty string, which is not valid.

uint SieveTest::sizeLimit() const

Returns the size limit for identifier() "test", and 0 for all other tests.

bool SieveTest::sizeOverLimit() const

Returns true if the test identifier() is "size" and the tag :over is active, and false in all other cases.

UStringList * SieveTest::takeHeaderFieldList( uint n )

As SieveArgumentList::takeStringList( n ), and additionally checks that each string is a valid header field name according to RFC 2822 section 3.6.8, and if identifier() is "address", that each refers to an address field. The result is filtered through EString::headerCased().

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