uri.js
No description.

File Location

/goog/uri/uri.js

Classes

goog.Uri
This class contains setters and getters for the parts of the URI. The getXyz/setXyz methods return the decoded part -- sogoog.Uri.parse('/foo%20bar').getPath() will return the decoded path, /foo bar. The constructor accepts an optional unparsed, raw URI string. The parser is relaxed, so special characters that aren't escaped but don't cause ambiguities will not cause parse failures. All setters return this and so may be chained, a la goog.Uri.parse('/foo').setFragment('part').toString().
goog.Uri.QueryData
Class used to represent URI query parameters. It is essentially a hash of name-value pairs, though a name can be present more than once. Has the same interface as the collections in goog.structs.

Public Protected Private

Global Functions

goog.Uri.create(opt_schemeopt_userInfoopt_domainopt_portopt_pathopt_queryopt_fragmentopt_ignoreCase) !goog.Uri
Creates a new goog.Uri object from unencoded parts.
Arguments:
opt_scheme : ?string=
Scheme/protocol or full URI to parse.
opt_userInfo : ?string=
username:password.
opt_domain : ?string=
opt_port : ?number=
9830.
opt_path : ?string=
/some/path/to/a/file.html.
opt_query : string | goog.Uri.QueryData=
a=1&b=2.
opt_fragment : ?string=
The fragment without the #.
opt_ignoreCase : boolean=
Whether to ignore parameter name case in #getParameterValue.
Returns: !goog.Uri  The new URI object.
code »
goog.Uri.QueryData.createFromKeysValues(keysvaluesopt_uriopt_ignoreCase) !goog.Uri.QueryData
Creates a new query data instance from parallel arrays of parameter names and values. Allows for duplicate parameter names. Throws an error if the lengths of the arrays differ.
Arguments:
keys : Array.<string>
Parameter names.
values : Array
Parameter values.
opt_uri : goog.Uri=
URI object that should have its cache invalidated when this object updates.
opt_ignoreCase : boolean=
If true, ignore the case of the parameter name in #get.
Returns: !goog.Uri.QueryData  The populated query data instance.
code »
goog.Uri.QueryData.createFromMap(mapopt_uriopt_ignoreCase) !goog.Uri.QueryData
Creates a new query data instance from a map of names and values.
Arguments:
map : !goog.structs.Map | !Object
Map of string parameter names to parameter value. If parameter value is an array, it is treated as if the key maps to each individual value in the array.
opt_uri : goog.Uri=
URI object that should have its cache invalidated when this object updates.
opt_ignoreCase : boolean=
If true, ignore the case of the parameter name in #get.
Returns: !goog.Uri.QueryData  The populated query data instance.
code »
goog.Uri.decodeOrEmpty_(val) string
Decodes a value or returns the empty string if it isn't defined or empty.
Arguments:
val : string | undefined
Value to decode.
Returns: string  Decoded value.
code »
goog.Uri.encodeChar_(ch) string
Converts a character in [\01-\177] to its unicode character equivalent.
Arguments:
ch : string
One character string.
Returns: string  Encoded string.
code »
goog.Uri.encodeSpecialChars_(unescapedPartextra) ?string
If unescapedPart is non null, then escapes any characters in it that aren't valid characters in a url and also escapes any special characters that appear in extra.
Arguments:
unescapedPart : *
The string to encode.
extra : RegExp
A character set of characters in [\01-\177].
Returns: ?string  null iff unescapedPart == null.
code »
goog.Uri.haveSameDomain(uri1Stringuri2String) boolean
Checks whether two URIs have the same domain.
Arguments:
uri1String : string
First URI string.
uri2String : string
Second URI string.
Returns: boolean  true if the two URIs have the same domain; false otherwise.
code »
goog.Uri.parse(uriopt_ignoreCase) !goog.Uri
Creates a uri from the string form. Basically an alias of new goog.Uri(). If a Uri object is passed to parse then it will return a clone of the object.
Arguments:
uri : *
Raw URI string or instance of Uri object.
opt_ignoreCase : boolean=
Whether to ignore the case of parameter names in #getParameterValue.
Returns: !goog.Uri  The new URI object.
code »
goog.Uri.removeDotSegments(path) string
Removes dot segments in given path component, as described in RFC 3986, section 5.2.4.
Arguments:
path : string
A non-empty path component.
Returns: string  Path component with removed dot segments.
code »
goog.Uri.resolve(baserel) !goog.Uri
Resolves a relative Uri against a base Uri, accepting both strings and Uri objects.
Arguments:
base : *
Base Uri.
rel : *
Relative Uri.
Returns: !goog.Uri  Resolved uri.
code »

Directory uri

File Reference