aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/fileutils.h
blob: 94bbdf639dfa82458b202210a656155844f459ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "core_global.h"

#include <utils/filepath.h>

namespace Utils { class Environment; }

namespace Core {

enum class HandleIncludeGuards { No, Yes };

namespace FileUtils {

// Helpers for common directory browser options.
CORE_EXPORT void showInGraphicalShell(const Utils::FilePath &path);
CORE_EXPORT void showInFileSystemView(const Utils::FilePath &path);
CORE_EXPORT void openTerminal(const Utils::FilePath &path, const Utils::Environment &env);
CORE_EXPORT QString msgFindInDirectory();
CORE_EXPORT QString msgFileSystemAction();
// Platform-dependent action descriptions
CORE_EXPORT QString msgGraphicalShellAction();
CORE_EXPORT QString msgTerminalHereAction();
CORE_EXPORT QString msgTerminalWithAction();
// File operations aware of version control and file system case-insensitiveness
CORE_EXPORT void removeFiles(const Utils::FilePaths &filePaths, bool deleteFromFS);
CORE_EXPORT bool renameFile(const Utils::FilePath &from, const Utils::FilePath &to,
                            HandleIncludeGuards handleGuards = HandleIncludeGuards::No);

CORE_EXPORT void updateHeaderFileGuardIfApplicable(const Utils::FilePath &oldFilePath,
                                                   const Utils::FilePath &newFilePath,
                                                   HandleIncludeGuards handleGuards);

} // namespace FileUtils
} // namespace Core