17 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_RESOURCE_NAMER_H_
18 #define NET_INSTAWEB_REWRITER_PUBLIC_RESOURCE_NAMER_H_
20 #include "base/logging.h"
25 namespace net_instaweb {
45 bool Decode(
const StringPiece& encoded_string,
int hash_length,
46 int signature_length);
69 int EventualSize(
const Hasher& hasher,
int signature_length)
const;
72 StringPiece
id()
const {
return id_; }
73 StringPiece options()
const {
return options_; }
74 StringPiece name()
const {
return name_; }
75 StringPiece hash()
const {
return hash_; }
76 StringPiece ext()
const {
return ext_; }
77 StringPiece experiment()
const {
return experiment_; }
78 StringPiece signature()
const {
return signature_; }
80 bool has_experiment()
const {
return !experiment_.empty(); }
81 bool has_options()
const {
return !options_.empty(); }
84 void set_id(
const StringPiece& p) { p.CopyToString(&id_); }
85 void set_options(
const StringPiece& opts) { opts.CopyToString(&options_); }
86 void set_name(
const StringPiece& n) { n.CopyToString(&name_); }
87 void set_hash(
const StringPiece& h) { h.CopyToString(&hash_); }
91 CHECK(e.empty() || e[0] !=
'.');
92 e.CopyToString(&ext_);
94 void set_experiment(
const StringPiece& e) { e.CopyToString(&experiment_); }
95 void set_signature(
const StringPiece& s) { s.CopyToString(&signature_); }
108 bool LegacyDecode(
const StringPiece& encoded_string);
void set_id(const StringPiece &p)
Simple setters.
Definition: resource_namer.h:84
bool Decode(const StringPiece &encoded_string, int hash_length, int signature_length)
Encoding and decoding in various formats.
StringPiece id() const
Simple getters.
Definition: resource_namer.h:72
GoogleString EncodeIdName() const
bool DecodeIgnoreHashAndSignature(StringPiece encoded_string)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
GoogleString PrettyName() const
Utility functions.
Definition: resource_namer.h:104
static const int kOverhead
Definition: resource_namer.h:36
void ClearHash()
Other setter-like operations.
Definition: resource_namer.h:98
int EventualSize(const Hasher &hasher, int signature_length) const
Note: there is no need at this time to decode the name key.
GoogleString Encode() const
void set_ext(const StringPiece &e)
Definition: resource_namer.h:88
Definition: resource_namer.h:32