Helper class for converting a URL into a filename.
More...
#include "url_to_filename_encoder.h"
|
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 const char | kEscapeChar |
|
static const char | kTruncationChar |
|
static const size_t | kMaximumSubdirectoryLength |
|
|
class | UrlToFilenameEncoderTest |
|
Helper class for converting a URL into a filename.
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: