Name

Url — A wrapper for Url.

Synopsis

class Url:
  

  # URL properties. 
  enum UrlProperty { PROTOCOL, USER, PASSWORD, HOST, PORT, PATH, QUERY, 
                     DIRPATH, FILENAME, COLLPATH, ENCODED_PATH_AND_QUERY };
  # construct/copy/destruct
  __init__(const SString &)
  __init__(const Url &)
  Url& operator=(const Url &)
  __del__()

  # public member functions

  SString get(const UrlProperty) const
  None set(const UrlProperty, const SString &) 
  bool isValid() const
  bool isLocal() const
  bool exists() const
  bool isRelative() const
  Url absolute() const
  Url combinePath2Path(const Url &) const
  Url combineDir2Path(const Url &) const
  Url relativePath(const Url &) const
  Url upperUrl() const
  bool operator==(const Url &) const
  bool operator!=(const Url &) const
  SString asString() const

  # public static functions

  SString encode(const SString &) 
  SString decode(const SString &) 

Description

Url construct/copy/destruct

  1. __init__(const SString & url)

    Constructs url from string.


  2. __init__(const Url & )


  3. Url& operator=(const Url & )


  4. __del__()


Url public member functions

  1. SString get(const UrlProperty ) const

    Query URL property.


  2. None set(const UrlProperty , const SString & value)

    Set URL property.


  3. bool isValid() const

    Returns TRUE if URL is valid.


  4. bool isLocal() const

    Check if the URL is a local file.


  5. bool exists() const

    Checks whether file exists (valid for local URL's only)


  6. bool isRelative() const

    Check if this is an relative filename (applies only to local URL)


  7. Url absolute() const

    Returns absolute path name if isLocal(); returns same URL otherwise.


  8. Url combinePath2Path(const Url & url) const

    Combine current URL with the specified URL; note that both URL's must not be dirnames


  9. Url combineDir2Path(const Url & url) const

    Combine current URL (which is assumed to be directory path) with the specified URL


  10. Url relativePath(const Url & url) const

    Returns URL which is a relative-only suffix to the base URL.


  11. Url upperUrl() const

    Returns URL which points to the parent (upper) path.


  12. bool operator==(const Url & other) const

    Returns TRUE if both URL's point to the same location.


  13. bool operator!=(const Url & other) const


  14. SString asString() const

    Conversion to SString.


Url public static functions

  1. SString encode(const SString & )

    Encode URL.


  2. SString decode(const SString & )

    Decode URL.