Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
file_load_mapping.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_FILE_LOAD_MAPPING_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_FILE_LOAD_MAPPING_H_
21 
27 
28 namespace net_instaweb {
29 
33  public:
34  virtual ~FileLoadMapping();
35 
38  virtual bool Substitute(StringPiece url, GoogleString* filename) const = 0;
39 };
40 
47  public:
48  FileLoadMappingLiteral(const GoogleString& url_prefix,
49  const GoogleString& filename_prefix)
50  : url_prefix_(url_prefix),
51  filename_prefix_(filename_prefix) {}
52 
53  virtual bool Substitute(StringPiece url, GoogleString* filename) const;
54 
55  private:
56  const GoogleString url_prefix_;
57  const GoogleString filename_prefix_;
58 
59 
60 };
61 
68  public:
69  FileLoadMappingRegexp(const GoogleString& url_regexp,
70  const GoogleString& filename_prefix)
71  : url_regexp_(url_regexp),
72  url_regexp_str_(url_regexp),
73  filename_prefix_(filename_prefix) {}
74 
75  virtual bool Substitute(StringPiece url, GoogleString* filename) const;
76 
77  private:
78  const RE2 url_regexp_;
80  const GoogleString url_regexp_str_;
81  const GoogleString filename_prefix_;
82 
83 
84 };
85 
86 }
87 
88 #endif
89 
Definition: file_load_mapping.h:32
virtual bool Substitute(StringPiece url, GoogleString *filename) const =0
virtual bool Substitute(StringPiece url, GoogleString *filename) const
Definition: file_load_mapping.h:46
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: manually_ref_counted.h:31
virtual bool Substitute(StringPiece url, GoogleString *filename) const
Definition: file_load_mapping.h:67