clang-tools  7.0.0
SymbolYAML.h
Go to the documentation of this file.
1 //===--- SymbolYAML.h --------------------------------------------*- 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 //
10 // SymbolYAML provides facilities to convert Symbol to YAML, and vice versa.
11 // The YAML format of Symbol is designed for simplicity and experiment, but
12 // isn't a suitable/efficient store.
13 //
14 // This is for **experimental** only. Don't use it in the production code.
15 //
16 //===---------------------------------------------------------------------===//
17 
18 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOL_FROM_YAML_H
19 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOL_FROM_YAML_H
20 
21 #include "Index.h"
22 #include "llvm/Support/Error.h"
23 #include "llvm/Support/YAMLTraits.h"
24 #include "llvm/Support/raw_ostream.h"
25 
26 namespace clang {
27 namespace clangd {
28 
29 // Read symbols from a YAML-format string.
30 SymbolSlab symbolsFromYAML(llvm::StringRef YAMLContent);
31 
32 // Read one symbol from a YAML-stream.
33 // The arena must be the Input's context! (i.e. yaml::Input Input(Text, &Arena))
34 // The returned symbol is backed by both Input and Arena.
35 Symbol SymbolFromYAML(llvm::yaml::Input &Input, llvm::BumpPtrAllocator &Arena);
36 
37 // Convert a single symbol to YAML-format string.
38 // The YAML result is safe to concatenate.
39 std::string SymbolToYAML(Symbol Sym);
40 
41 // Convert symbols to a YAML-format string.
42 // The YAML result is safe to concatenate if you have multiple symbol slabs.
43 void SymbolsToYAML(const SymbolSlab &Symbols, llvm::raw_ostream &OS);
44 
45 } // namespace clangd
46 } // namespace clang
47 
48 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOL_FROM_YAML_H
void SymbolsToYAML(const SymbolSlab &Symbols, llvm::raw_ostream &OS)
Definition: SymbolYAML.cpp:192
std::string SymbolToYAML(Symbol Sym)
Definition: SymbolYAML.cpp:198
Symbol SymbolFromYAML(llvm::yaml::Input &Input, llvm::BumpPtrAllocator &Arena)
Definition: SymbolYAML.cpp:184
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
SymbolSlab symbolsFromYAML(llvm::StringRef YAMLContent)
Definition: SymbolYAML.cpp:171