Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::WildcardGroup Class Reference

#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
 

Detailed Description

This forms the basis of a wildcard selection mechanism, allowing a user to issue a 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: 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 is allowed by 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: