Files
qt-creator/src/plugins/clangformat/clangformatutils.h
Artem Sokolovskii a20c4c4490 ClangFormat: Fix the "Open Used .clang-format File" function
- FilePathify related functions
- Logic of related functions were updated to use new configuration
files location and new settings variables

Change-Id: I9f5504fc72f5c051a83dc80e1feb2e13272de146
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-20 10:29:51 +00:00

42 lines
1.3 KiB
C++

// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "clangformatsettings.h"
#include <utils/fileutils.h>
#include <utils/id.h>
#include <clang/Format/Format.h>
#include <QFile>
#include <fstream>
namespace TextEditor { class ICodeStylePreferences; }
namespace ProjectExplorer { class Project; }
namespace ClangFormat {
QString projectUniqueId(ProjectExplorer::Project *project);
bool getProjectUseGlobalSettings(const ProjectExplorer::Project *project);
bool getProjectOverriddenSettings(const ProjectExplorer::Project *project);
bool getCurrentOverriddenSettings(const Utils::FilePath &filePath);
ClangFormatSettings::Mode getProjectIndentationOrFormattingSettings(
const ProjectExplorer::Project *project);
ClangFormatSettings::Mode getCurrentIndentationOrFormattingSettings(const Utils::FilePath &filePath);
Utils::FilePath configForFile(const Utils::FilePath &fileName);
Utils::FilePath findConfig(const Utils::FilePath &fileName);
bool getProjectOverriddenSettings(const ProjectExplorer::Project *project);
void addQtcStatementMacros(clang::format::FormatStyle &style);
clang::format::FormatStyle qtcStyle();
Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreferences *codeStyle);
}