internal package Foswiki::Contrib::DBCacheContrib::Search internal package Foswiki::Contrib::DBCacheContrib::Search
$db = new Foswiki::Contrib::DBCacheContrib::DBCache( $web ); # always done
$db->load();
my $search = new Foswiki::Contrib::DBCacheContrib::Search("date EARLIER_THAN '1st January 2000'");
foreach my $topic ($db->getKeys()) {
my $attachments = $topic->fastget("attachments");
foreach my $val ($attachments->getValues()) {
if ($search->matches($val)) {
print $val->fastget("name") . "\n";
}
}
}
A search object implements the "matches" method as its general contract with the rest of the world.
new($string) $string - string containing an expression to parse
toString() -> string --+++ =addOperator(%oper) Add an operator to the parser
%oper is a hash, containing the following fields: name - operator string
prec - operator precedence, positive non-zero integer. Larger number => higher precedence.
arity - set to 1 if this operator is unary, 2 for binary. Arity 0 is legal, should you ever need it.
exec - the handler to implement the new operator