Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Public Attributes | Friends | List of all members
net_instaweb::UrlToFilenameEncoder Class Reference

Helper class for converting a URL into a filename. More...

#include "url_to_filename_encoder.h"

Static Public Member Functions

static void EncodeSegment (const StringPiece &filename_prefix, const StringPiece &escaped_ending, char dir_separator, GoogleString *encoded_filename)
 
static bool Decode (const StringPiece &encoded_filename, GoogleString *decoded_url)
 

Static Public Attributes

static const char kEscapeChar
 
static const char kTruncationChar
 
static const size_t kMaximumSubdirectoryLength
 

Friends

class UrlToFilenameEncoderTest
 

Detailed Description

Helper class for converting a URL into a filename.

Member Function Documentation

static bool net_instaweb::UrlToFilenameEncoder::Decode ( const StringPiece &  encoded_filename,
GoogleString decoded_url 
)
static

Decodes a filename that was encoded with EncodeSegment with dir_separator = '/', yielding back the original URL.

Note: this decoder is not the exact inverse of the UrlToFilenameEncoder::EncodeSegment, because it does not take into account a prefix.

static void net_instaweb::UrlToFilenameEncoder::EncodeSegment ( const StringPiece &  filename_prefix,
const StringPiece &  escaped_ending,
char  dir_separator,
GoogleString encoded_filename 
)
static

Encode a portion of URL to a form suitable for filenames. |filename_prefix| is prepended without escaping. |escaped_ending| is the URL to be encoded into a filename. It may have URL escaped characters (like %21 for !). |dir_separator| is "/" on Unix, "\" on Windows. |encoded_filename| is the resultant filename.


The documentation for this class was generated from the following file: