KDevelop API Documentation

urlutil.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
00003    Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef _URLUTIL_H_
00022 #define _URLUTIL_H_
00023 
00024 #include <qstring.h>
00025 #include <qvaluelist.h>
00026 #include <kurl.h>
00027 
00028 namespace URLUtil
00029 {
00030   enum SlashesPosition { SLASH_PREFIX = 1, SLASH_SUFFIX = 2 };
00031 
00035   QString filename(const QString & pathName);
00039   QString directory(const QString & pathName);
00043   QString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX);
00047   QString relativePath(const QString & parent, const QString & child, uint slashPolicy = SLASH_PREFIX);
00055   QString relativePathToFile( const QString & dirUrl, const QString & fileUrl );
00059   QString upDir(const QString & path, bool slashSuffix = false);
00068   KURL mergeURL(const KURL & source, const KURL & dest, const KURL & child);
00072   QString getExtension(const QString & path);
00073 
00088   QString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url );
00089   QString extractPathNameRelative(const QString &basePath, const KURL &url );
00090   QString extractPathNameRelative(const QString &basePath, const QString &absFilePath );
00091 
00096   QString extractPathNameAbsolute( const KURL &url );
00097 
00101   QStringList toRelativePaths( const QString &baseDir, const KURL::List &urls);
00102 
00106   bool isDirectory( const KURL &url );
00107   bool isDirectory( const QString &absFilePath );
00108 
00113   void dump( const KURL::List &urls, const QString &aMessage = QString::null );
00114 
00119   QString canonicalPath( const QString & path );
00120 
00128     QString envExpand ( const QString &variable );
00129 
00130 }
00131 
00132 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:52 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003