URLUtil Namespace Reference
Enumerations | |
enum | SlashesPosition { SLASH_PREFIX = 1, SLASH_SUFFIX = 2 } |
Functions | |
QString | filename (const QString &pathName) |
Returns the filename part of a pathname (i.e. | |
QString | directory (const QString &pathName) |
Returns the directory part of a path (i.e. | |
QString | relativePath (const KURL &parent, const KURL &child, uint slashPolicy=SLASH_PREFIX) |
Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent. | |
QString | relativePath (const QString &parent, const QString &child, uint slashPolicy=SLASH_PREFIX) |
Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent. | |
QString | relativePathToFile (const QString &dirUrl, const QString &fileUrl) |
Returns the relative path between a directory and file. | |
QString | upDir (const QString &path, bool slashSuffix=false) |
Returns the path 'up one level' - the opposite of what filename returns. | |
KURL | mergeURL (const KURL &source, const KURL &dest, const KURL &child) |
'Merges' URLs - changes a URL that starts with dest to start with source instead Example: source is /home/me/ dest is /home/you/ child is /home/you/dir1/file1 returns /home/me/dir1/fil1 | |
QString | getExtension (const QString &path) |
Returns the file extension for a filename or path. | |
QString | extractPathNameRelative (const KURL &baseDirUrl, const KURL &url) |
Given a base directory url in baseDirUrl and the url referring to a date sub-directory or file, it will return the path relative to baseDirUrl . | |
QString | extractPathNameRelative (const QString &basePath, const KURL &url) |
QString | extractPathNameRelative (const QString &basePath, const QString &absFilePath) |
QString | extractPathNameAbsolute (const KURL &url) |
Will return the absolute path name referred in url . | |
QStringList | toRelativePaths (const QString &baseDir, const KURL::List &urls) |
Returns a QStringList of relative (to baseDir ) paths from a list of KURLs in urls . | |
bool | isDirectory (const KURL &url) |
If url is a directory will return true, false otherwise. | |
bool | isDirectory (const QString &absFilePath) |
void | dump (const KURL::List &urls, const QString &aMessage=QString::null) |
Will dump the list of KURL urls on standard output, eventually printing @ aMessage if it is not null. | |
QString | canonicalPath (const QString &path) |
Same as QDir::canonicalPath in later versions of QT. | |
QString | envExpand (const QString &variable) |
Performs environment variable expansion on variable . |
Enumeration Type Documentation
|
|
Function Documentation
|
|
Returns the directory part of a path (i.e. everything up to but not including the last slash) Definition at line 50 of file urlutil.cpp. Referenced by AutoProjectWidget::addFiles(), and FileCreatePart::createNewFile(). |
|
Will dump the list of KURL
Definition at line 190 of file urlutil.cpp. References endl(), and kdDebug(). Referenced by CvsServicePartImpl::addFilesToProject(), subversionPart::contextMenu(), CvsServicePart::contextMenu(), CvsServicePartImpl::prepareOperation(), and CvsServicePartImpl::removedFilesFromProject(). |
|
Performs environment variable expansion on
Definition at line 287 of file urlutil.cpp. References len. Referenced by DocTreeViewWidget::DocTreeViewWidget(). |
|
Will return the absolute path name referred in Look at above for an example. Definition at line 157 of file urlutil.cpp. References isDirectory(), and KURL::path(). Referenced by extractPathNameRelative(). |
|
Definition at line 143 of file urlutil.cpp. References extractPathNameRelative(). |
|
Definition at line 131 of file urlutil.cpp. References extractPathNameRelative(). |
|
Given a base directory url in
If baseDirUrl == url.path() then it will return ".". Definition at line 114 of file urlutil.cpp. References extractPathNameAbsolute(). Referenced by VCSFileTreeBranchItem::createTreeViewItem(), extractPathNameRelative(), AddExistingDirectoriesDialog::slotAddAll(), AddExistingDirectoriesDialog::slotAddSelected(), AddExistingDirectoriesDialog::slotDropped(), VCSFileTreeWidgetImpl::slotSyncWithRepository(), and toRelativePaths(). |
|
Returns the filename part of a pathname (i.e. everything past the last slash) Definition at line 43 of file urlutil.cpp. Referenced by FileCreatePart::createNewFile(). |
|
Returns the file extension for a filename or path.
Definition at line 106 of file urlutil.cpp. |
|
Definition at line 183 of file urlutil.cpp. |
|
If
Definition at line 176 of file urlutil.cpp. References KURL::path(). Referenced by extractPathNameAbsolute(), and FileContext::Private::Private(). |
|
'Merges' URLs - changes a URL that starts with dest to start with source instead Example: source is /home/me/ dest is /home/you/ child is /home/you/dir1/file1 returns /home/me/dir1/fil1
Definition at line 85 of file urlutil.cpp. References KURL::cmp(), KURL::isParentOf(), and KURL::url(). |
|
Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent.
Definition at line 71 of file urlutil.cpp. References relativePath(). |
|
Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent.
Definition at line 57 of file urlutil.cpp. References KURL::cmp(), KURL::isParentOf(), KURL::path(), SLASH_PREFIX, and SLASH_SUFFIX. Referenced by TrollProjectWidget::addFiles(), AutoProjectWidget::allFiles(), RunOptionsWidget::browseMainProgram(), FileCreatePart::createNewFile(), and relativePath(). |
|
Returns the relative path between a directory and file. Should never return empty path. Example: dirUrl: /home/test/src fileUrl: /home/test/lib/mylib.cpp returns: ../lib/mylib.cpp Definition at line 221 of file urlutil.cpp. References file. |
|
Returns a QStringList of relative (to
Definition at line 207 of file urlutil.cpp. References extractPathNameRelative(). Referenced by CvsServicePartImpl::fileList(). |
|
Returns the path 'up one level' - the opposite of what filename returns.
Definition at line 77 of file urlutil.cpp. |