Page Speed Optimization Libraries  1.8.31.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Attributes
net_instaweb::ResourceNamer Class Reference

#include "resource_namer.h"

List of all members.

Public Member Functions

bool Decode (const StringPiece &encoded_string)
 Encoding and decoding in various formats.
GoogleString Encode () const
GoogleString EncodeIdName () const
int EventualSize (const Hasher &hasher) const
 Note: there is no need at this time to decode the name key.
StringPiece id () const
 Simple getters.
StringPiece options () const
StringPiece name () const
StringPiece hash () const
StringPiece ext () const
StringPiece experiment () const
bool has_experiment () const
bool has_options () const
void set_id (const StringPiece &p)
 Simple setters.
void set_options (const StringPiece &opts)
void set_name (const StringPiece &n)
void set_hash (const StringPiece &h)
void set_ext (const StringPiece &e)
void set_experiment (const StringPiece &e)
void ClearHash ()
 Other setter-like operations.
void CopyFrom (const ResourceNamer &other)
GoogleString PrettyName () const
 Utility functions.

Static Public Attributes

static const int kOverhead

Detailed Description

Encapsulates the naming of resource URL leafs. The class holds the context of a single resource, and is not intended for re-use. We could, of course, add a Clear(), but it is a stateful class.


Member Function Documentation

bool net_instaweb::ResourceNamer::Decode ( const StringPiece &  encoded_string)

Encoding and decoding in various formats.

Decodes an entire resource name (NAME.pagespeed[.EXPT].ID.HASH.EXT), placing the result in the fields in this encoder.

GoogleString net_instaweb::ResourceNamer::Encode ( ) const

Encodes the fields in this encoder into an absolute url, with the trailing portion "NAME.pagespeed[.(EXPT|PsolOpts)].ID.HASH.EXT".

Encode a key that can used to do a lookup based on an id and the name. This key can be used to find the hash-code for a resource within the origin TTL.

The 'id' is a short code indicating which Instaweb rewriter was used to generate the resource.

int net_instaweb::ResourceNamer::EventualSize ( const Hasher &  hasher) const

Note: there is no need at this time to decode the name key.

Eventual length of name. Gets eventual hash length from passed in hasher. Needed by RewriteDriver to check that filenames aren't too long.

GoogleString net_instaweb::ResourceNamer::PrettyName ( ) const [inline]

Utility functions.

Name suitable for debugging and logging

void net_instaweb::ResourceNamer::set_ext ( const StringPiece &  e) [inline]
Todo:
TODO(jmaessen): Remove check after transitioning to undotted extensions everywhere.

Member Data Documentation

This determines the overhead imposed on each URL by the ResourceNamer syntax, such as separators.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines