clang 17.0.0git
|
The serializer that organizes API information in the Symbol Graph format. More...
#include "clang/ExtractAPI/Serialization/SymbolGraphSerializer.h"
Public Types | |
enum | RelationshipKind { MemberOf , InheritsFrom , ConformsTo } |
The kind of a relationship between two symbols. More... | |
Public Member Functions | |
Object | serialize () |
Serialize the APIs in APISet in the Symbol Graph format. | |
void | serialize (raw_ostream &os) override |
Implement the APISerializer::serialize interface. | |
SymbolGraphSerializer (const APISet &API, const APIIgnoresList &IgnoresList, APISerializerOption Options={}, bool ShouldRecurse=true) | |
![]() | |
virtual void | serialize (raw_ostream &os)=0 |
Serialize the API information to os . | |
APISerializer ()=delete | |
APISerializer (const APISerializer &)=delete | |
APISerializer (APISerializer &&)=delete | |
APISerializer & | operator= (const APISerializer &)=delete |
APISerializer & | operator= (APISerializer &&)=delete |
Static Public Member Functions | |
static std::optional< Object > | serializeSingleSymbolSGF (StringRef USR, const APISet &API) |
Serialize a single symbol SGF. | |
static StringRef | getRelationshipString (RelationshipKind Kind) |
Get the string representation of the relationship kind. | |
Additional Inherited Members | |
![]() | |
APISerializer (const APISet &API, const APIIgnoresList &IgnoresList, APISerializerOption Options={}) | |
virtual | ~APISerializer ()=default |
![]() | |
const APISet & | API |
const APIIgnoresList & | IgnoresList |
The list of symbols to ignore. | |
APISerializerOption | Options |
The serializer that organizes API information in the Symbol Graph format.
The Symbol Graph format (https://github.com/apple/swift-docc-symbolkit) models an API set as a directed graph, where nodes are symbol declarations, and edges are relationships between the connected symbols.
Definition at line 39 of file SymbolGraphSerializer.h.
The kind of a relationship between two symbols.
Definition at line 75 of file SymbolGraphSerializer.h.
|
inline |
Definition at line 163 of file SymbolGraphSerializer.h.
|
static |
Get the string representation of the relationship kind.
Definition at line 653 of file SymbolGraphSerializer.cpp.
References ConformsTo, InheritsFrom, and MemberOf.
Object SymbolGraphSerializer::serialize | ( | ) |
Serialize the APIs in APISet
in the Symbol Graph format.
Definition at line 820 of file SymbolGraphSerializer.cpp.
References clang::extractapi::APISerializer::API, Enum, clang::extractapi::APISet::getEnums(), clang::extractapi::APISet::getGlobalFunctions(), clang::extractapi::APISet::getGlobalVariables(), clang::extractapi::APISet::getMacros(), clang::extractapi::APISet::getObjCInterfaces(), clang::extractapi::APISet::getObjCProtocols(), clang::extractapi::APISet::getStructs(), and clang::extractapi::APISet::getTypedefs().
Referenced by serialize().
|
overridevirtual |
Implement the APISerializer::serialize interface.
Wrap serialize(void) and write out the serialized JSON object to os
.
Implements clang::extractapi::APISerializer.
Definition at line 864 of file SymbolGraphSerializer.cpp.
References clang::extractapi::APISerializerOption::Compact, clang::extractapi::APISerializer::Options, and serialize().
|
static |
Serialize a single symbol SGF.
This is primarily used for libclang.
None
. Definition at line 873 of file SymbolGraphSerializer.cpp.
References clang::extractapi::APISerializer::API, clang::extractapi::APISet::findRecordForUSR(), clang::PresumedLoc::getFilename(), clang::extractapi::APISet::getLanguage(), clang::extractapi::APIRecord::IsFromSystemHeader, clang::extractapi::APIRecord::Location, clang::extractapi::APISet::ProductName, and clang::extractapi::APIRecord::USR.