net_instaweb::WildcardGroup Class Reference

#include "wildcard_group.h"

List of all members.

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

Detailed Description

This forms the basis of a wildcard selection mechanism, allowing a user to issue sequence of commands like:

1. allow *.cc 2. allow *.h 3. disallow a*.h 4. allow ab*.h 5. disallow c*.cc

This sequence would yield the following results whnen 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.


Member Function Documentation

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 matches the wildcard group. If none of the wildcards in the group matches, allow_by_default is returned.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:21 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3