File indexing completed on 2024-05-12 17:16:25

0001 /*
0002  * Port for usage with qt-framework and development for kdesvn
0003  * Copyright (C) 2005-2009 by Rajko Albrecht (ral@alwins-world.de)
0004  * http://kdesvn.alwins-world.de
0005  */
0006 /*
0007  * ====================================================================
0008  * Copyright (c) 2002-2005 The RapidSvn Group.  All rights reserved.
0009  * dev@rapidsvn.tigris.org
0010  *
0011  * This library is free software; you can redistribute it and/or
0012  * modify it under the terms of the GNU Lesser General Public
0013  * License as published by the Free Software Foundation; either
0014  * version 2.1 of the License, or (at your option) any later version.
0015  *
0016  * This library is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019  * Lesser General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public
0022  * License along with this library (in the file LGPL.txt); if not,
0023  * write to the Free Software Foundation, Inc., 51 Franklin St,
0024  * Fifth Floor, Boston, MA  02110-1301  USA
0025  *
0026  * This software consists of voluntary contributions made by many
0027  * individuals.  For exact contribution history, see the revision
0028  * history and logs, available at http://rapidsvn.tigris.org/.
0029  * ====================================================================
0030  */
0031 
0032 #ifndef SVNQT_URL_H
0033 #define SVNQT_URL_H
0034 
0035 #include <svnqt/svnqt_defines.h>
0036 
0037 #include <QUrl>
0038 #include "path.h"
0039 
0040 namespace svn
0041 {
0042 class SVNQT_EXPORT Url
0043 {
0044 private:
0045     svn::Path m_url;
0046 public:
0047     /** Constructor */
0048     Url() = default;
0049     Url(const Url &) = default;
0050     explicit Url(const QUrl &url);
0051     explicit Url(const svn::Path &url);
0052 
0053     /** Destructor */
0054     ~Url() = default;
0055 
0056     QByteArray cstr()const;
0057 
0058     /**
0059      * Checks if @a url is valid
0060      *
0061      * Example of a valid URL:
0062      *   http://svn.collab.net/repos/svn
0063      * Example of an invalid URL:
0064      *   /home/foo/bar
0065      */
0066     static bool isValid(const QString &url);
0067 
0068     /**
0069      * Checks if @a url points to a local filesystem.
0070      *
0071      * @return true if url is accessed local without network.
0072      */
0073     static bool isLocal(const QString &url);
0074 
0075     static QString transformProtokoll(const QString &);
0076 
0077 };
0078 }
0079 
0080 #endif
0081 /* -----------------------------------------------------------------
0082  * local variables:
0083  * eval: (load-file "../../rapidsvn-dev.el")
0084  * end:
0085  */
0086