• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

  • Relative
  • URL
Public Member Functions | Static Public Member Functions | List of all members
Relative::URL Class Reference

#include <rurl.h>

Inheritance diagram for Relative::URL:
Relative::Name Relative::Directory Relative::File

Public Member Functions

 URL (KURL base, KURL url, Type type=Auto)
 
 URL (KURL base, TQString url, bool isUrlRelative, Type type=Auto)
 
void setBase (const KURL &base)
 
void setBase (const TQString &base)
 
KURL base () const
 
TQString basePath () const
 
KURL url () const
 
TQString urlPath () const
 
TQString urlDirectory () const
 
URL relativeTo (KURL base)
 
bool operator== (const URL &url)
 
bool operator!= (const URL &url)
 
- Public Member Functions inherited from Relative::Name
 Name (const TQString &rurl, const Type type=Auto)
 
 Name (const char *rurl, const Type type=Auto)
 
void setRURL (const TQString &rurl, const Type type)
 
TQString rurl () const
 
void addPath (const TQString &addendum)
 
void cleanRURL ()
 
TQString extension (bool complete=true) const
 
TQString fileName () const
 
TQString directory () const
 
bool isFile () const
 
bool isDirectory () const
 
bool isValid () const
 
Type type () const
 
void setType (const Type type)
 
bool operator== (const Name &rname)
 
bool operator!= (const Name &rname)
 

Static Public Member Functions

static URL relativeURL (KURL base, KURL url)
 
static URL relativeURL (KURL base, TQString url, bool isUrlRelative)
 
- Static Public Member Functions inherited from Relative::Name
static Name relativeName (const TQString &base, const TQString &url)
 
static TQString cleanName (const TQString &rurl)
 
static TQString correctName (const TQString &rurl, const Type type=Auto)
 

Additional Inherited Members

- Public Types inherited from Relative::Name
enum  Type { File, Directory, Auto }
 
- Protected Member Functions inherited from Relative::Name
void correct ()
 

Detailed Description

Relative name of file or directory to some base location.

Definition at line 91 of file rurl.h.

Constructor & Destructor Documentation

◆ URL() [1/2]

Relative::URL::URL ( KURL  base,
KURL  url,
Type  type = Auto 
)

Evaluates the relative path between url and base and creates RURL object.

base should be an url to the directory or location, not a file. The check is not performed. url should be the usual url. Only the path of this url is taken into account when evaluating relative path.

Definition at line 235 of file rurl.cpp.

◆ URL() [2/2]

Relative::URL::URL ( KURL  base,
TQString  url,
bool  isUrlRelative,
Type  type = Auto 
)

Creates RURL object with given base and relative or full url (according to the isUrlRelative value).

Definition at line 240 of file rurl.cpp.

Member Function Documentation

◆ base()

KURL Relative::URL::base ( ) const

Returns RURL base.

Definition at line 257 of file rurl.cpp.

◆ basePath()

TQString Relative::URL::basePath ( ) const

Returns a path of a base KURL (using KURL::path()).

Trailing slash is guaranteed.

Definition at line 262 of file rurl.cpp.

◆ relativeTo()

URL Relative::URL::relativeTo ( KURL  base)

Returns a new URL that is relative to given base.

Relative part is taken from current URL object.

Definition at line 296 of file rurl.cpp.

◆ relativeURL() [1/2]

URL Relative::URL::relativeURL ( KURL  base,
KURL  url 
)
static

Returns a new relative URL constructed from base and given url.

Definition at line 301 of file rurl.cpp.

◆ relativeURL() [2/2]

URL Relative::URL::relativeURL ( KURL  base,
TQString  url,
bool  isUrlRelative 
)
static

Returns a new relative URL constructed from base and given url.

url parameter is either relative or full (depends on isUrlRelative value).

Definition at line 306 of file rurl.cpp.

◆ setBase() [1/2]

void Relative::URL::setBase ( const KURL &  base)

Sets a new base for a RURL.

Definition at line 245 of file rurl.cpp.

◆ setBase() [2/2]

void Relative::URL::setBase ( const TQString &  base)

Sets a new base for a RURL.

Base is is considered to be a directory and converted to KURL using KURL::setPath().

Definition at line 250 of file rurl.cpp.

◆ url()

KURL Relative::URL::url ( ) const

Returns a complete url to the RURL location.

This is basically base + rurl. This also resolves ".." components in path. Directories always have trailing slash in KURL (this means that if url() == "file:/test/dir/" then url() != KURL("/test/dir") and url() == KURL("/test/dir/").

Definition at line 267 of file rurl.cpp.

◆ urlDirectory()

TQString Relative::URL::urlDirectory ( ) const

Returns a directory of a complete url to the location.

The url is constructed as base + rurl. Returns the same as urlPath() for directories. This method uses KURL::directory to determine the directory. Trailing slash is guaranteed. This also resolves ".." components in path.

Definition at line 288 of file rurl.cpp.

◆ urlPath()

TQString Relative::URL::urlPath ( ) const

Returns a path of a complete url to the location.

The url is basically base + rurl. This method only returns a path part of the KURL (using KURL::path()). Trailing slash is guaranteed for directories and no trailing slash - for files. This also resolves ".." components in path.

Definition at line 275 of file rurl.cpp.


The documentation for this class was generated from the following files:
  • rurl.h
  • rurl.cpp

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.