Page Speed Optimization Libraries
1.13.35.1
|
#include "wildcard_group.h"
Public Member Functions | |
bool | Match (const StringPiece &str, bool allow_by_default) const |
void | Allow (const StringPiece &wildcard) |
void | Disallow (const StringPiece &wildcard) |
void | CopyFrom (const WildcardGroup &src) |
void | AppendFrom (const WildcardGroup &src) |
GoogleString | Signature () const |
This forms the basis of a wildcard selection mechanism, allowing a user to issue a sequence of commands like:
This sequence would yield the following results: Match("x.cc") –> true due to rule #1 Match("c.cc") –> false due to rule #5 which overrides rule #1 Match("y.h") –> true due to rule #2 Match("a.h") –> false due to rule #3 which overrides rule #2 Match("ab.h") –> true due to rule #4 which overrides rule #3 So order matters.
void net_instaweb::WildcardGroup::Allow | ( | const StringPiece & | wildcard | ) |
Add an expression to Allow, potentially overriding previous calls to Disallow.
void net_instaweb::WildcardGroup::Disallow | ( | const StringPiece & | wildcard | ) |
Add an expression to Disallow, potentially overriding previous calls to Allow.
bool net_instaweb::WildcardGroup::Match | ( | const StringPiece & | str, |
bool | allow_by_default | ||
) | const |
Determines whether a string is allowed by the wildcard group. If none of the wildcards in the group matches, allow_by_default is returned.