• 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 
34 namespace 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::isDirectory
bool isDirectory(const KURL &url)
Definition: urlutil.cpp:195
URLUtil::getRelativePath
TQString getRelativePath(const TQString &base, const TQString &dest)
Definition: urlutil.cpp:53
URLUtil::extractPathNameAbsolute
TQString extractPathNameAbsolute(const KURL &url)
Definition: urlutil.cpp:176
URLUtil::toRelativePaths
TQStringList toRelativePaths(const TQString &baseDir, const KURL::List &urls)
Definition: urlutil.cpp:226
URLUtil::filename
TQString filename(const TQString &pathName)
Definition: urlutil.cpp:39
URLUtil::SlashesPosition
SlashesPosition
Position of a slash in the URL.
Definition: urlutil.h:37
URLUtil::getExtension
TQString getExtension(const TQString &path)
Definition: urlutil.cpp:134
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:142
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:209
URLUtil::relativePathToFile
TQString relativePathToFile(const TQString &dirUrl, const TQString &fileUrl)
Definition: urlutil.cpp:240
URLUtil::canonicalPath
TQString canonicalPath(const TQString &path)
Same as TQDir::canonicalPath in later versions of TQt.
Definition: urlutil.cpp:285
URLUtil::upDir
TQString upDir(const TQString &path, bool slashSuffix=false)
Definition: urlutil.cpp:105
URLUtil::mergeURL
KURL mergeURL(const KURL &source, const KURL &dest, const KURL &child)
&#39;Merges&#39; URLs - changes a URL that starts with dest to start with source instead. ...
Definition: urlutil.cpp:113
URLUtil::directory
TQString directory(const TQString &pathName)
Definition: urlutil.cpp:46
URLUtil::SLASH_SUFFIX
URL has slash as a suffix.
Definition: urlutil.h:39
URLUtil
Utility functions to operate on URLs.
Definition: urlutil.h:34
URLUtil::envExpand
TQString envExpand(const TQString &variable)
Performs environment variable expansion on variable.
Definition: urlutil.cpp:295
URLUtil::SLASH_PREFIX
URL has slash as a prefix.
Definition: urlutil.h:38
URLUtil::relativePath
TQString relativePath(const KURL &parent, const KURL &child, uint slashPolicy=SLASH_PREFIX)
Definition: urlutil.cpp:85

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.