Class Search.

Inherits Command. Inherited by Sort and Thread.

Finds messages matching some criteria (RFC 3501 section 6.4.4)

The entirety of the basic syntax is handled, as well as ESEARCH (RFC 4731 and RFC 4466), of CONDSTORE (RFC 4551), ANNOTATE (RFC 5257) and WITHIN (RFC 5032).

Searches are first run against the RAM cache, rudimentarily. If the comparison is difficult, expensive or unsuccessful, it gives up and uses the database.

If ESEARCH with only MIN, only MAX or only COUNT is used, we could generate better SQL than we do. Let's do that optimisation when a client benefits from it.

Search::Search( bool u )

Constructs an empty Search. If u is true, it's a UID SEARCH, otherwise it's the MSN variety.

void Search::considerCache()

Considers whether this search can and should be solved using this cache, and if so, finds all the matches.

EString Search::date()

Parses the IMAP date production and returns the string (sans quotes). Month names are case-insensitive; RFC 3501 is not entirely clear about that.

Selector * Search::parseKey()

Parse one search key (IMAP search-key) and returns a pointer to the corresponding Selector. Leaves the cursor on the first character following the search-key.

Selector * Search::selector() const

Returns the root Selector constructed while parsing this Search command.

void Search::sendResponse()

Makes sure a SEARCH or ESEARCH response is sent, whichever is appropriate.

IntegerSet Search::set( bool parseMsns )

This reimplementation of Command::set() simplifies the set by including messages that don't exist. parseMsns is as for Command::set().

Reimplements Command::set().

void Search::setCharset( const EString & s )

This helper function is called by the parser to set the CHARSET for this search to s.

UString Search::ustring( Command::QuoteMode stringType )

Reads an argument of type stringType (which may be AString, NString, or PlainString) and returns it as unicode, using the charset specified in the CHARSET argument to SEARCH.

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