#include "rewrite_gflags.h"
Public Member Functions | |
RewriteGflags (const char *progname, int *argc, char ***argv) | |
The constructor parses the options. | |
RewriteGflags () | |
bool | SetOptions (RewriteDriverFactory *factory, RewriteOptions *options) const |
int64 | lru_cache_size_bytes () const |
bool | WasExplicitlySet (const char *name) const |
bool | SetRewriters (const char *rewriters_flag_name, const char *rewriters_value, const char *rewrite_level_flag_name, const char *rewrite_level_value, RewriteOptions *options, MessageHandler *handler) const |
Implements rewriter options as command-line options, using the Google "gflags" package.
net_instaweb::RewriteGflags::RewriteGflags | ( | ) | [inline] |
Constructor that does no option parsing. For use in rewrite_proxy, where InitGoogle is called [google] explicitly after sandbox fork. [google]
int64 net_instaweb::RewriteGflags::lru_cache_size_bytes | ( | ) | const |
LRU size is potentially needed at factory construction time so it is exposed as a method.
bool net_instaweb::RewriteGflags::SetOptions | ( | RewriteDriverFactory * | factory, | |
RewriteOptions * | options | |||
) | const |
Apply the parsed options to the options and factory. Note that some of the command-line flags control how the factory is constructed, whereas others affect the rewriting options, and should be considered global defaults.
bool net_instaweb::RewriteGflags::SetRewriters | ( | const char * | rewriters_flag_name, | |
const char * | rewriters_value, | |||
const char * | rewrite_level_flag_name, | |||
const char * | rewrite_level_value, | |||
RewriteOptions * | options, | |||
MessageHandler * | handler | |||
) | const |
Sets the rewrite level/list passed on the specified option names & values. The flag names are passed in to provide better error messages.
False is returned if the values cannot be parsed.
bool net_instaweb::RewriteGflags::WasExplicitlySet | ( | const char * | name | ) | const |
Determines whether a flag was explicitly set, as opposed to having its default value.