clang  5.0.0
Public Member Functions | Static Public Member Functions | List of all members
clang::tooling::JSONCompilationDatabase Class Reference

#include "clang/Tooling/JSONCompilationDatabase.h"

Inheritance diagram for clang::tooling::JSONCompilationDatabase:
[legend]
Collaboration diagram for clang::tooling::JSONCompilationDatabase:
[legend]

Public Member Functions

std::vector< CompileCommandgetCompileCommands (StringRef FilePath) const override
 Returns all compile commands in which the specified file was compiled. More...
 
std::vector< std::string > getAllFiles () const override
 Returns the list of all files available in the compilation database. More...
 
std::vector< CompileCommandgetAllCompileCommands () const override
 Returns all compile commands for all the files in the compilation database. More...
 
- Public Member Functions inherited from clang::tooling::CompilationDatabase
virtual ~CompilationDatabase ()
 

Static Public Member Functions

static std::unique_ptr
< JSONCompilationDatabase
loadFromFile (StringRef FilePath, std::string &ErrorMessage, JSONCommandLineSyntax Syntax)
 Loads a JSON compilation database from the specified file. More...
 
static std::unique_ptr
< JSONCompilationDatabase
loadFromBuffer (StringRef DatabaseString, std::string &ErrorMessage, JSONCommandLineSyntax Syntax)
 Loads a JSON compilation database from a data buffer. More...
 
- Static Public Member Functions inherited from clang::tooling::CompilationDatabase
static std::unique_ptr
< CompilationDatabase
loadFromDirectory (StringRef BuildDirectory, std::string &ErrorMessage)
 Loads a compilation database from a build directory. More...
 
static std::unique_ptr
< CompilationDatabase
autoDetectFromSource (StringRef SourceFile, std::string &ErrorMessage)
 Tries to detect a compilation database location and load it. More...
 
static std::unique_ptr
< CompilationDatabase
autoDetectFromDirectory (StringRef SourceDir, std::string &ErrorMessage)
 Tries to detect a compilation database location and load it. More...
 

Detailed Description

Definition at line 59 of file JSONCompilationDatabase.h.

Member Function Documentation

std::vector< CompileCommand > clang::tooling::JSONCompilationDatabase::getAllCompileCommands ( ) const
overridevirtual

Returns all compile commands for all the files in the compilation database.

Implements clang::tooling::CompilationDatabase.

Definition at line 230 of file JSONCompilationDatabase.cpp.

std::vector< std::string > clang::tooling::JSONCompilationDatabase::getAllFiles ( ) const
overridevirtual

Returns the list of all files available in the compilation database.

These are the 'file' entries of the JSON objects.

Implements clang::tooling::CompilationDatabase.

Definition at line 215 of file JSONCompilationDatabase.cpp.

References Result.

std::vector< CompileCommand > clang::tooling::JSONCompilationDatabase::getCompileCommands ( StringRef  FilePath) const
overridevirtual

Returns all compile commands in which the specified file was compiled.

FIXME: Currently FilePath must be an absolute path inside the source directory which does not have symlinks resolved.

Implements clang::tooling::CompilationDatabase.

Definition at line 196 of file JSONCompilationDatabase.cpp.

References clang::tooling::FileMatchTrie::findEquivalent().

std::unique_ptr< JSONCompilationDatabase > clang::tooling::JSONCompilationDatabase::loadFromBuffer ( StringRef  DatabaseString,
std::string &  ErrorMessage,
JSONCommandLineSyntax  Syntax 
)
static

Loads a JSON compilation database from a data buffer.

Returns NULL and sets ErrorMessage if the database could not be loaded.

Definition at line 183 of file JSONCompilationDatabase.cpp.

std::unique_ptr< JSONCompilationDatabase > clang::tooling::JSONCompilationDatabase::loadFromFile ( StringRef  FilePath,
std::string &  ErrorMessage,
JSONCommandLineSyntax  Syntax 
)
static

Loads a JSON compilation database from the specified file.

Returns NULL and sets ErrorMessage if the database could not be loaded from the given file.

Definition at line 166 of file JSONCompilationDatabase.cpp.

References Result.


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