mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

net/

mgneturlquoter__define.pro

includes main-level program

Object that converts strings to values that are safe to use in URLs.

Examples

Try the main-level example program at the end of this file:

IDL> .run mgneturlquoter__define

Class description for mgneturlquoter

Properties

Properties in mgneturlquoter

safe init type=string

string of characters that don't need to be replaced, i.e., they are safe to use in an URL; the default is /

Routines

Routines from mgneturlquoter__define.pro

result = mgneturlquoter::quote(str)

Convert special characters in str using the %xx escape sequence.

result = mgneturlquoter::quotePlus(str)

Similar to the quote method, but converts spaces to + signs instead of the normal %xx notation.

result = mgneturlquoter::unquote(str)

Replace %xx escape sequences by their single-character equivalent.

result = mgneturlquoter::unquotePlus(str)

Replace %xx escape sequences by their single-character equivalent and replace + sign with space.

result = mgneturlquoter::init(safe=string)

Create a quoter object.

mgneturlquoter__define

Define instance variables.

Routine details

top mgneturlquoter::quote

result = mgneturlquoter::quote(str)

Convert special characters in str using the %xx escape sequence. The alphaumeric characters, _, ., and - are always safe to use.

Parameters

str in required type=string

string to convert

Examples

For example:

IDL> print, quoter->quote('/Boulder, CO.html') /Boulder%2C%20CO.html

top mgneturlquoter::quotePlus

result = mgneturlquoter::quotePlus(str)

Similar to the quote method, but converts spaces to + signs instead of the normal %xx notation.

Parameters

str in required type=string

string to convert

Examples

For example:

IDL> print, quoter->quotePlus('/Boulder, CO.html') /Boulder%2C+CO.html

top mgneturlquoter::unquote

result = mgneturlquoter::unquote(str)

Replace %xx escape sequences by their single-character equivalent.

Parameters

str

Examples

For example:

IDL> print, quoter->unquote('/Boulder%2C%20CO.html') /Boulder, CO.html
; :Params: str : in, required, type=string string to convert

top mgneturlquoter::unquotePlus

result = mgneturlquoter::unquotePlus(str)

Replace %xx escape sequences by their single-character equivalent and replace + sign with space.

Parameters

str in required type=string

string to convert

Examples

For example:

IDL> print, quoter->unquotePlus('/Boulder%2C+CO.html') /Boulder, CO.html

top mgneturlquoter::init

result = mgneturlquoter::init(safe=string)

Create a quoter object.

Return value

1 for success, 0 for failure

Keywords

safe type=string

string of characters that don't need to be replaced, i.e., they are safe to use in an URL; the default is /

top mgneturlquoter__define

mgneturlquoter__define

Define instance variables.

File attributes

Modification date: Wed May 14 15:07:14 2014
Lines: 70
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.