Mnemonic URL string library
General Info

Introduction
Screenshots
Mailing Lists and IRC
Alternative Browsers
Special Thanks

FAQ
Understanding Mnemonic
TODO list and ideas
Bug Reports


User Info

Download binaries
Platforms
Compiling Mnemonic
Other useful software


Developer Info

Core
Message modules
Library modules
Object modules
Coding Guidelines
Browse Source
Using CVS


View with any browser

Website questions to:
webmaster@mnemonic.org

Mnemonic questions to:
disc@mnemonic.org

 

Overview

The `lib-url' library is a small C++ library for manipulations of universal resource locators (urls) as well as http uuencodings (the latter is unsupported at the moment). It follows the specifications as laid out in RFC 1738.

In particular, it supports both absolute urls,

scheme://username:passwd@host:port/abspath[;param][?query][#fragment]
and relative urls, which borrow unknown parts from their referrer,
scheme:abspath scheme:relpath

Usage

The url_strings are initialised using normal C++ strings, as in

#include <url/url_string.hh>

url_string foo("http://www.mnemonic.org:8000/bar");
and then offer the following functionality. You can extract the scheme (`http'), the net-path (`www.mnemonic.org'), the port number (`8000'), and the absolute path (`/bar'). Ditto for all the other supported elements (see above).

For relative urls, the strings should be initialised with two parameters, the second one being the referring url. In this case, the relative path can be extracted as well by calling get_relative_path.

Refer to the header file url_string.hh for the details of member functions.

Password information

Password information can be added at any time by calling the set_username(...) and set_passwd(...) members. The password information will not be visible when you call get_url(); instead, there will be a number of stars. If you need the password, always call get_passwd().