clang 19.0.0git
Public Member Functions | Public Attributes | List of all members
clang::FixItOptions Class Referenceabstract

#include "clang/Rewrite/Frontend/FixItRewriter.h"

Public Member Functions

 FixItOptions ()=default
 
virtual ~FixItOptions ()
 
virtual std::string RewriteFilename (const std::string &Filename, int &fd)=0
 This file is about to be rewritten.
 

Public Attributes

bool InPlace = false
 True if files should be updated in place.
 
bool FixWhatYouCan = false
 Whether to abort fixing a file when not all errors could be fixed.
 
bool FixOnlyWarnings = false
 Whether to only fix warnings and not errors.
 
bool Silent = false
 If true, only pass the diagnostic to the actual diagnostic consumer if it is an error or a fixit was applied as part of the diagnostic.
 

Detailed Description

Definition at line 33 of file FixItRewriter.h.

Constructor & Destructor Documentation

◆ FixItOptions()

clang::FixItOptions::FixItOptions ( )
default

◆ ~FixItOptions()

FixItOptions::~FixItOptions ( )
virtualdefault

Member Function Documentation

◆ RewriteFilename()

virtual std::string clang::FixItOptions::RewriteFilename ( const std::string &  Filename,
int fd 
)
pure virtual

This file is about to be rewritten.

Return the name of the file that is okay to write to.

Parameters
fdout parameter for file descriptor. After the call it may be set to an open file descriptor for the returned filename, or it will be -1 otherwise.

Referenced by clang::FixItRewriter::WriteFixedFiles().

Member Data Documentation

◆ FixOnlyWarnings

bool clang::FixItOptions::FixOnlyWarnings = false

Whether to only fix warnings and not errors.

Definition at line 54 of file FixItRewriter.h.

Referenced by clang::FixItRewriter::HandleDiagnostic().

◆ FixWhatYouCan

bool clang::FixItOptions::FixWhatYouCan = false

Whether to abort fixing a file when not all errors could be fixed.

Definition at line 51 of file FixItRewriter.h.

Referenced by clang::FixItRewriter::WriteFixedFiles().

◆ InPlace

bool clang::FixItOptions::InPlace = false

True if files should be updated in place.

RewriteFilename is only called if this is false.

Definition at line 48 of file FixItRewriter.h.

Referenced by clang::FixItRewriter::WriteFixedFiles().

◆ Silent

bool clang::FixItOptions::Silent = false

If true, only pass the diagnostic to the actual diagnostic consumer if it is an error or a fixit was applied as part of the diagnostic.

It basically silences warnings without accompanying fixits.

Definition at line 59 of file FixItRewriter.h.

Referenced by clang::FixItRewriter::HandleDiagnostic().


The documentation for this class was generated from the following files: