2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-08-16 18:55:23 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-08-16 18:55:23 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-08-16 18:55:23 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-08-16 18:55:23 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-08-16 18:55:23 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-08-16 18:55:23 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-08-16 18:55:23 +02:00
|
|
|
|
2019-01-08 16:05:57 +01:00
|
|
|
#include "core_global.h"
|
2011-08-16 18:55:23 +02:00
|
|
|
|
2011-08-17 15:16:54 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
2011-08-16 18:55:23 +02:00
|
|
|
class QWidget;
|
2011-08-17 15:16:54 +02:00
|
|
|
QT_END_NAMESPACE
|
2011-08-16 18:55:23 +02:00
|
|
|
|
2018-08-31 10:54:47 +02:00
|
|
|
namespace Utils { class Environment; }
|
|
|
|
|
|
2011-08-16 18:55:23 +02:00
|
|
|
namespace Core {
|
|
|
|
|
|
2020-05-08 18:06:26 +02:00
|
|
|
enum class HandleIncludeGuards { No, Yes };
|
|
|
|
|
|
2011-08-16 18:55:23 +02:00
|
|
|
struct CORE_EXPORT FileUtils
|
|
|
|
|
{
|
|
|
|
|
// Helpers for common directory browser options.
|
|
|
|
|
static void showInGraphicalShell(QWidget *parent, const QString &path);
|
|
|
|
|
static void openTerminal(const QString &path);
|
2018-08-31 10:54:47 +02:00
|
|
|
static void openTerminal(const QString &path, const Utils::Environment &env);
|
2013-09-24 12:12:09 +03:00
|
|
|
static QString msgFindInDirectory();
|
2011-08-16 18:55:23 +02:00
|
|
|
// Platform-dependent action descriptions
|
|
|
|
|
static QString msgGraphicalShellAction();
|
2019-04-26 20:47:23 +02:00
|
|
|
static QString msgTerminalHereAction();
|
|
|
|
|
static QString msgTerminalWithAction();
|
2012-07-18 13:41:13 +04:00
|
|
|
// File operations aware of version control and file system case-insensitiveness
|
|
|
|
|
static void removeFile(const QString &filePath, bool deleteFromFS);
|
2020-05-08 18:06:26 +02:00
|
|
|
static bool renameFile(const QString &from, const QString &to,
|
|
|
|
|
HandleIncludeGuards handleGuards = HandleIncludeGuards::No);
|
|
|
|
|
// This method is used to refactor the include guards in the renamed headers
|
|
|
|
|
static bool updateHeaderFileGuardAfterRename(const QString &headerPath, const QString &oldHeaderBaseName);
|
2011-08-16 18:55:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Core
|