/*************************************************************************** * Copyright (C) 2005-2006 Nicolas Hadacek * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef PURL_H #define PURL_H #include "common/global/global.h" #if QT_VERSION<0x040000 # include #else # include # include #endif #include "common/global/log.h" #include "common/common/purl_base.h" namespace PURL { //---------------------------------------------------------------------------- class Http : public QHttp { Q_OBJECT public: Http(const QString &hostname); QHttpResponseHeader _header; private slots: void responseHeaderReceivedSlot(const QHttpResponseHeader &rh) { _header = rh; } }; class Url; class Directory; class Private; enum SeparatorType { UnixSeparator, WindowsSeparator }; //---------------------------------------------------------------------------- class Base { public: Base(const QString &filepath = QString::null); Base(const KURL &url); bool operator <(const Base &url) const { return _url { public: UrlList() {} UrlList(const Url &url) { append(url); } UrlList(const QValueList &list) : QValueList(list) {} #if !defined(NO_KDE) UrlList(const KURL::List &list); #endif }; //---------------------------------------------------------------------------- class Directory : public Base { public: Directory(const QString &path = QString::null); QStringList files(const QString &filter) const; Url findMatchingFilename(const QString &filename) const; Directory up() const; Directory down(const QString &path) const; static Directory current(); #if !defined(NO_KDE) bool create(Log::Generic &log) const; #endif }; } // namespace #endif