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

KDevelop Utility Library

  • lib
  • util
urlutil.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
3 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef _URLUTIL_H_
22#define _URLUTIL_H_
23
24#include <tqstring.h>
25#include <tqvaluelist.h>
26#include <kurl.h>
27
32
34namespace URLUtil
35{
37 enum SlashesPosition {
38 SLASH_PREFIX = 1 ,
39 SLASH_SUFFIX = 2
40 };
41
46 TQString filename(const TQString & pathName);
51 TQString directory(const TQString & pathName);
62 TQString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX);
73 TQString relativePath(const TQString & parent, const TQString & child, uint slashPolicy = SLASH_PREFIX);
79 TQString getRelativePath( const TQString& base, const TQString& dest );
89 TQString relativePathToFile( const TQString & dirUrl, const TQString & fileUrl );
95 TQString upDir(const TQString & path, bool slashSuffix = false);
108 KURL mergeURL(const KURL & source, const KURL & dest, const KURL & child);
113 TQString getExtension(const TQString & path);
114
133 TQString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url );
135 TQString extractPathNameRelative(const TQString &basePath, const KURL &url );
137 TQString extractPathNameRelative(const TQString &basePath, const TQString &absFilePath );
138
144 TQString extractPathNameAbsolute( const KURL &url );
145
151 TQStringList toRelativePaths( const TQString &baseDir, const KURL::List &urls);
152
157 bool isDirectory( const KURL &url );
162 bool isDirectory( const TQString &absFilePath );
163
170 void dump( const KURL::List &urls, const TQString &aMessage = TQString() );
171
177 TQString canonicalPath( const TQString & path );
178
186 TQString envExpand ( const TQString &variable );
187
188}
189
190#endif
URLUtil
Utility functions to operate on URLs.
Definition urlutil.h:35
URLUtil::envExpand
TQString envExpand(const TQString &variable)
Performs environment variable expansion on variable.
Definition urlutil.cpp:294
URLUtil::filename
TQString filename(const TQString &pathName)
Definition urlutil.cpp:38
URLUtil::directory
TQString directory(const TQString &pathName)
Definition urlutil.cpp:45
URLUtil::dump
void dump(const KURL::List &urls, const TQString &aMessage=TQString())
Dumps the list of KURL urls on standard output, eventually printing aMessage if it is not null.
Definition urlutil.cpp:208
URLUtil::canonicalPath
TQString canonicalPath(const TQString &path)
Same as TQDir::canonicalPath in later versions of TQt.
Definition urlutil.cpp:284
URLUtil::extractPathNameRelative
TQString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url)
Given a base directory url in baseDirUrl and the url referring to the sub-directory or file,...
Definition urlutil.cpp:141
URLUtil::relativePathToFile
TQString relativePathToFile(const TQString &dirUrl, const TQString &fileUrl)
Definition urlutil.cpp:239
URLUtil::mergeURL
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.
Definition urlutil.cpp:112
URLUtil::isDirectory
bool isDirectory(const KURL &url)
Definition urlutil.cpp:194
URLUtil::toRelativePaths
TQStringList toRelativePaths(const TQString &baseDir, const KURL::List &urls)
Definition urlutil.cpp:225
URLUtil::extractPathNameAbsolute
TQString extractPathNameAbsolute(const KURL &url)
Definition urlutil.cpp:175
URLUtil::getRelativePath
TQString getRelativePath(const TQString &base, const TQString &dest)
Definition urlutil.cpp:52
URLUtil::relativePath
TQString relativePath(const KURL &parent, const KURL &child, uint slashPolicy=SLASH_PREFIX)
Definition urlutil.cpp:84
URLUtil::getExtension
TQString getExtension(const TQString &path)
Definition urlutil.cpp:133
URLUtil::SlashesPosition
SlashesPosition
Position of a slash in the URL.
Definition urlutil.h:37
URLUtil::SLASH_PREFIX
@ SLASH_PREFIX
URL has slash as a prefix.
Definition urlutil.h:38
URLUtil::SLASH_SUFFIX
@ SLASH_SUFFIX
URL has slash as a suffix.
Definition urlutil.h:39
URLUtil::upDir
TQString upDir(const TQString &path, bool slashSuffix=false)
Definition urlutil.cpp:104

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.15.0
This website is maintained by Timothy Pearson.