Page Speed Optimization Libraries
1.13.35.1
|
#include "url_multipart_encoder.h"
Public Member Functions | |
virtual void | Encode (const StringVector &urls, const ResourceContext *data, GoogleString *encoding) const |
virtual bool | Decode (const StringPiece &url_segment, StringVector *urls, ResourceContext *data, MessageHandler *handler) const |
Encodes a multiple strings into a single string so that it can be decoded. This is not restricted to URLs but is optimized for them in its choice of escape characters. '+' is used to separate the parts, and any parts that include '+' are prefixed by a '='. '=' is converted to '==' – it's a pretty lightweight encoding, and any other character restrictions will have to be applied to the output of this class.
TODO(jmarantz): One possibly improvement is to bake this functionality into UrlEscaper, changing its interface to accept arbitrary numbers of pieces in & out. However, that would change an interface that's used in multiple places, so this is left as a
TODO.
|
virtual |
Decode URLs from "url_segment". Note that there may be other meta-data encoded in url_segment, which this function will write into out_data, if present.
Reimplemented from net_instaweb::UrlSegmentEncoder.
|
virtual |
Encodes arbitrary text so it can be used in a url segment. A url segment must contain only characters that are legal in URLs, and exclude "/" and "." which are used for a higher level encoding scheme into which this must fit.
'data' is optional – it can be NULL and it is up to the encoder to decide what to do.
Reimplemented from net_instaweb::UrlSegmentEncoder.