Class Search.

Inherits Command. Inherited by Sort.

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) and parts of CONDSTORE (RFC 4551). SEARCHM probably will need to be implemented as a subclass of Search.

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.

String 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::sendEsearchResponse()

Sends the ESEARCH response.

void Search::sendResponse()

Calls either sendSearchResponse or sendEsearchResponse(), whichever is appropriate.

void Search::sendSearchResponse()

Sends the SEARCH response.

MessageSet 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 String & 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 Oryx Mail Systems GmbH. All rights reserved.