PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/guitone-1.0rc5/src/util/Platform.h

#
C Header | 49 lines | 13 code | 5 blank | 31 comment | 0 complexity | 4daa05b99f70c85c60829e83f40c7978 MD5 | raw file
Possible License(s): GPL-3.0
 1/***************************************************************************
 2 *   Copyright (C) 2007 by Thomas Keller                                   *
 3 *   me@thomaskeller.biz                                                   *
 4 *                                                                         *
 5 *   This program is free software; you can redistribute it and/or modify  *
 6 *   it under the terms of the GNU General Public License as published by  *
 7 *   the Free Software Foundation, either version 3 of the License, or     *
 8 *   (at your option) any later version.                                   *
 9 *                                                                         *
10 *   This program 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         *
13 *   GNU General Public License for more details.                          *
14 *                                                                         *
15 *   You should have received a copy of the GNU General Public License     *
16 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18
19#ifndef PLATFORM_H
20#define PLATFORM_H
21
22#include <QString>
23#include <QDir>
24
25class Platform
26{
27public:
28  /**
29   * Opens a file or URL with the default registered handler
30   * The URL is assumed to be valid. No security checks are performed.
31   */
32  static void openFile(const QString & filename, bool isSymlink = false);
33  /**
34   * Returns the name of the currently logged in user of the system
35   */
36  static QString getUsername();
37  /**
38   * Safely tries to create the directory path from the argument and if
39   * the path already exists, ensures that its valid and writable
40   */
41  static QDir safeMakePath(const QString & path);
42  /**
43   * Executes rm -rf on the path
44   */
45  static void removeRecursively(const QString & path);
46};
47
48#endif
49