clang  8.0.0svn
Public Member Functions | List of all members
clang::tooling::IncludeCategoryManager Class Reference

This class manages priorities of C++ #include categories and calculates priorities for headers. More...

#include "clang/Tooling/Inclusions/HeaderIncludes.h"

Public Member Functions

 IncludeCategoryManager (const IncludeStyle &Style, StringRef FileName)
 
int getIncludePriority (StringRef IncludeName, bool CheckMainHeader) const
 Returns the priority of the category which IncludeName belongs to. More...
 

Detailed Description

This class manages priorities of C++ #include categories and calculates priorities for headers.

FIXME(ioeric): move this class into implementation file when clang-format's include sorting functions are also moved here.

Definition at line 27 of file HeaderIncludes.h.

Constructor & Destructor Documentation

◆ IncludeCategoryManager()

clang::tooling::IncludeCategoryManager::IncludeCategoryManager ( const IncludeStyle Style,
StringRef  FileName 
)

Member Function Documentation

◆ getIncludePriority()

int clang::tooling::IncludeCategoryManager::getIncludePriority ( StringRef  IncludeName,
bool  CheckMainHeader 
) const

Returns the priority of the category which IncludeName belongs to.

If CheckMainHeader is true and IncludeName is a main header, returns 0. Otherwise, returns the priority of the matching category or INT_MAX. NOTE: this API is not thread-safe!

Definition at line 164 of file HeaderIncludes.cpp.

References INT_MAX, and clang::ast_matchers::match().

Referenced by clang::tooling::HeaderIncludes::insert().


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