|
clang-tools 23.0.0git
|
This file contains the implementation of the JSONGenerator, which serializes the clang-doc internal representation (Info structures) into JSON format. More...
#include "Generators.h"#include "clang/Basic/Specifiers.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/Support/JSON.h"Go to the source code of this file.
Namespaces | |
| namespace | clang |
| ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===// | |
| namespace | clang::doc |
Functions | |
| template<typename Container, typename SerializationFunc> | |
| static void | serializeArray (const Container &Records, Object &Obj, const StringRef Key, SerializationFunc SerializeInfo, const StringRef EndKey="End", function_ref< void(Object &)> UpdateJson=[](Object &Obj) {}) |
| static constexpr unsigned | getMaxParamWrapLimit () |
| static void | insertNonEmpty (StringRef Key, StringRef Value, Object &Obj) |
| static std::string | infoTypeToString (InfoType IT) |
| static void | insertComment (Object &Description, json::Value &Comment, StringRef Key) |
| Insert comments into a key in the Description object. | |
| static json::Value | extractTextComments (Object *ParagraphComment) |
| Takes the nested "Children" array from a comment Object. | |
| static json::Value | extractVerbatimComments (json::Array VerbatimLines) |
| static Object | serializeComment (const CommentInfo &I, Object &Description) |
| static void | serializeDescription (const DocList< CommentInfo > &Description, json::Object &Obj, StringRef Key="") |
| static void | serializeTemplateSpecialization (TemplateInfo Template, Object &TemplateObj) |
| static void | insertArray (Object &Obj, json::Value &Array, StringRef Key) |
| static std::vector< Index > | preprocessCDCtxIndex (Index CDCtxIndex) |
| static GeneratorRegistry::Add< JSONGenerator > | JSON (JSONGenerator::Format, "Generator for JSON output.") |
Variables | |
| static auto | SerializeTemplateParam |
This file contains the implementation of the JSONGenerator, which serializes the clang-doc internal representation (Info structures) into JSON format.
It handles the mapping of C++ constructs like namespaces, records, functions, and enums to their JSON equivalents, enabling downstream tools to consume the structured documentation data.
Definition in file JSONGenerator.cpp.
|
static |
Takes the nested "Children" array from a comment Object.
Definition at line 187 of file JSONGenerator.cpp.
Referenced by serializeComment(), and serializeDescription().
|
static |
Definition at line 208 of file JSONGenerator.cpp.
Referenced by serializeComment().
|
staticconstexpr |
Definition at line 34 of file JSONGenerator.cpp.
Referenced by serializeTemplateSpecialization().
|
static |
Definition at line 109 of file JSONGenerator.cpp.
References clang::doc::IT_concept, clang::doc::IT_default, clang::doc::IT_enum, clang::doc::IT_friend, clang::doc::IT_function, clang::doc::IT_namespace, clang::doc::IT_record, clang::doc::IT_typedef, and clang::doc::IT_variable.
|
static |
Definition at line 720 of file JSONGenerator.cpp.
|
static |
Insert comments into a key in the Description object.
| Comment | Either an Object or Array, depending on the comment type |
| Key | The type (Brief, Code, etc.) of comment to be inserted |
Definition at line 158 of file JSONGenerator.cpp.
Referenced by serializeComment(), and serializeDescription().
|
static |
Definition at line 104 of file JSONGenerator.cpp.
|
static |
| CDCtxIndex | Passed by copy since clang-doc's context is passed to the generator as const |
Definition at line 880 of file JSONGenerator.cpp.
References clang::doc::Index::Children, clang::doc::Reference::getFileBaseName(), clang::doc::Reference::getRelativeFilePath(), clang::doc::Index::getSortedChildren(), clang::doc::internString(), clang::doc::Reference::Path, and clang::doc::Index::sort().
|
static |
Definition at line 557 of file JSONGenerator.cpp.
Referenced by serializeTemplateSpecialization().
|
static |
Definition at line 220 of file JSONGenerator.cpp.
References clang::doc::CommentInfo::Args, clang::doc::CommentInfo::AttrKeys, clang::doc::CommentInfo::AttrValues, clang::doc::CommentInfo::Children, clang::doc::CK_BlockCommandComment, clang::doc::CK_FullComment, clang::doc::CK_HTMLEndTagComment, clang::doc::CK_HTMLStartTagComment, clang::doc::CK_InlineCommandComment, clang::doc::CK_ParagraphComment, clang::doc::CK_ParamCommandComment, clang::doc::CK_TextComment, clang::doc::CK_TParamCommandComment, clang::doc::CK_Unknown, clang::doc::CK_VerbatimBlockComment, clang::doc::CK_VerbatimBlockLineComment, clang::doc::CK_VerbatimLineComment, clang::doc::CommentInfo::CloseName, clang::doc::commentKindToString(), clang::doc::CommentInfo::Direction, clang::doc::CommentInfo::Explicit, extractTextComments(), extractVerbatimComments(), insertComment(), clang::doc::CommentInfo::Kind, clang::doc::CommentInfo::Name, clang::doc::CommentInfo::ParamName, clang::doc::CommentInfo::SelfClosing, serializeComment(), and clang::doc::CommentInfo::Text.
Referenced by serializeComment(), and serializeDescription().
|
static |
Definition at line 406 of file JSONGenerator.cpp.
References extractTextComments(), insertComment(), and serializeComment().
|
static |
Definition at line 469 of file JSONGenerator.cpp.
References getMaxParamWrapLimit(), serializeArray(), and SerializeTemplateParam.
|
static |
Definition at line 464 of file JSONGenerator.cpp.
Referenced by serializeTemplateSpecialization().