~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/net/instaweb/rewriter/public/rewrite_gflags.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2011 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
 
 
17
 
// Author: jmarantz@google.com (Joshua Marantz)
18
 
 
19
 
#ifndef NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_GFLAGS_H_
20
 
#define NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_GFLAGS_H_
21
 
 
22
 
#include "net/instaweb/util/public/basictypes.h"
23
 
 
24
 
namespace net_instaweb {
25
 
 
26
 
class MessageHandler;
27
 
class RewriteDriverFactory;
28
 
class RewriteOptions;
29
 
 
30
 
// Implements rewriter options as command-line options, using the
31
 
// Google "gflags" package.
32
 
class RewriteGflags {
33
 
 public:
34
 
  // The constructor parses the options.
35
 
  RewriteGflags(const char* progname, int* argc, char*** argv);
36
 
 
37
 
  // Constructor that does no option parsing.
38
 
  RewriteGflags() {}
39
 
 
40
 
  // Apply the parsed options to the options and factory.  Note that some of
41
 
  // the command-line flags control how the factory is constructed, whereas
42
 
  // others affect the rewriting options, and should be considered global
43
 
  // defaults.
44
 
  bool SetOptions(RewriteDriverFactory* factory, RewriteOptions* options) const;
45
 
 
46
 
  // LRU size is potentially needed at factory construction time so it
47
 
  // is exposed as a method.
48
 
  int64 lru_cache_size_bytes() const;
49
 
 
50
 
  // Determines whether a flag was explicitly set, as opposed to having its
51
 
  // default value.
52
 
  static bool WasExplicitlySet(const char* name);
53
 
 
54
 
  // Sets the rewrite level/list passed on the specified option names
55
 
  // & values.  The flag names are passed in to provide better error
56
 
  // messages.
57
 
  //
58
 
  // False is returned if the values cannot be parsed.
59
 
  bool SetRewriters(const char* rewriters_flag_name,
60
 
                    const char* rewriters_value,
61
 
                    const char* rewrite_level_flag_name,
62
 
                    const char* rewrite_level_value,
63
 
                    RewriteOptions* options,
64
 
                    MessageHandler* handler) const;
65
 
 
66
 
 private:
67
 
  // There is no data in this class because the underlying gflags
68
 
  // class holds the parsed options in globals.
69
 
 
70
 
  DISALLOW_COPY_AND_ASSIGN(RewriteGflags);
71
 
};
72
 
 
73
 
}  // namespace net_instaweb
74
 
 
75
 
#endif  // NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_GFLAGS_H_