clang-tools 8.0.0

Generators.h
Go to the documentation of this file.
1 //===-- Generators.h - ClangDoc Generator ----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // Generator classes for converting declaration information into documentation
10 // in a specified format.
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_GENERATOR_H
14 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_GENERATOR_H
15
16 #include "Representation.h"
17 #include "llvm/Support/Error.h"
18 #include "llvm/Support/Registry.h"
19
20 namespace clang {
21 namespace doc {
22
23 // Abstract base class for generators.
24 // This is expected to be implemented and exposed via the GeneratorRegistry.
25 class Generator {
26 public:
27 virtual ~Generator() = default;
28
29 // Write out the decl info in the specified format.
30 virtual llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS) = 0;
31 };
32
33 typedef llvm::Registry<Generator> GeneratorRegistry;
34
35 llvm::Expected<std::unique_ptr<Generator>>
36 findGeneratorByName(llvm::StringRef Format);
37
38 } // namespace doc
39 } // namespace clang
40
41 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_GENERATOR_H
Representation.h
clang::doc::Generator::~Generator
virtual ~Generator()=default
clang::doc::findGeneratorByName
llvm::Expected< std::unique_ptr< Generator > > findGeneratorByName(llvm::StringRef Format)
Definition: Generators.cpp:18
clang::doc::Generator
Definition: Generators.h:25
clang::doc::Info
A base struct for Infos.
Definition: Representation.h:157
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::doc::Generator::generateDocForInfo
virtual llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS)=0
clang::doc::GeneratorRegistry
llvm::Registry< Generator > GeneratorRegistry
Definition: Generators.h:33