Changeset View
Changeset View
Standalone View
Standalone View
include/clang/Format/Format.h
Show First 20 Lines • Show All 746 Lines • ▼ Show 20 Lines | tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, | ||||
unsigned *Cursor = nullptr); | unsigned *Cursor = nullptr); | ||||
/// \brief Returns the replacements corresponding to applying and formatting | /// \brief Returns the replacements corresponding to applying and formatting | ||||
/// \p Replaces. | /// \p Replaces. | ||||
tooling::Replacements formatReplacements(StringRef Code, | tooling::Replacements formatReplacements(StringRef Code, | ||||
const tooling::Replacements &Replaces, | const tooling::Replacements &Replaces, | ||||
const FormatStyle &Style); | const FormatStyle &Style); | ||||
/// \brief In addition to applying all replacements in \p Replaces to \p Code, | |||||
/// this function also reformats the changed code after applying replacements. | |||||
/// | |||||
/// \pre Replacements must be for the same file and conflict-free. | |||||
/// | |||||
/// Replacement applications happen independently of the success of | |||||
/// other applications. | |||||
/// | |||||
/// \returns the changed code with all replacements applied and formatted, if | |||||
/// successful. An empty string otherwise. | |||||
/// | |||||
/// See also "include/clang/Tooling/Core/Replacements.h". | |||||
std::string applyAllReplacementsAndFormat(StringRef Code, | |||||
const tooling::Replacements &Replaces, | |||||
const FormatStyle &Style); | |||||
/// \brief Reformats the given \p Ranges in the file \p ID. | /// \brief Reformats the given \p Ranges in the file \p ID. | ||||
/// | /// | ||||
/// Each range is extended on either end to its next bigger logic unit, i.e. | /// Each range is extended on either end to its next bigger logic unit, i.e. | ||||
/// everything that might influence its formatting or might be influenced by its | /// everything that might influence its formatting or might be influenced by its | ||||
/// formatting. | /// formatting. | ||||
/// | /// | ||||
/// Returns the ``Replacements`` necessary to make all \p Ranges comply with | /// Returns the ``Replacements`` necessary to make all \p Ranges comply with | ||||
/// \p Style. | /// \p Style. | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |