00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019 #ifndef NET_INSTAWEB_UTIL_PUBLIC_WILDCARD_GROUP_H_
00020 #define NET_INSTAWEB_UTIL_PUBLIC_WILDCARD_GROUP_H_
00021
00022 #include <vector>
00023 #include "net/instaweb/util/public/basictypes.h"
00024 #include "net/instaweb/util/public/string.h"
00025 #include "net/instaweb/util/public/string_util.h"
00026
00027 namespace net_instaweb {
00028
00029 class Wildcard;
00030
00047 class WildcardGroup {
00048 public:
00049 WildcardGroup() {}
00050 ~WildcardGroup();
00051
00055 bool Match(const StringPiece& str, bool allow_by_default) const;
00056
00059 void Allow(const StringPiece& wildcard);
00060
00063 void Disallow(const StringPiece& wildcard);
00064
00065 void CopyFrom(const WildcardGroup& src);
00066 void AppendFrom(const WildcardGroup& src);
00067
00068 GoogleString Signature() const;
00069
00070 private:
00071 void Clear();
00072
00076 std::vector<Wildcard*> wildcards_;
00077 std::vector<bool> allow_;
00078 DISALLOW_COPY_AND_ASSIGN(WildcardGroup);
00079 };
00080
00081 }
00082
00083 #endif ///< NET_INSTAWEB_UTIL_PUBLIC_WILDCARD_GROUP_H_