0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Namespaces | Functions
clang_utils.h File Reference
#include "common/model/enums.h"
#include "common/model/namespace.h"
#include "common/model/template_parameter.h"
#include "config/config.h"
#include "types.h"
#include "util/util.h"
#include <clang/AST/Expr.h>
#include <clang/AST/RecursiveASTVisitor.h>
#include <deque>
#include <filesystem>
#include <string>

Go to the source code of this file.

Namespaces

namespace  clang
 
namespace  clanguml
 
namespace  clanguml::common
 

Functions

model::access_t clanguml::common::access_specifier_to_access_t (clang::AccessSpecifier access_specifier)
 Convert clang::AccessSpecifier to.
 
std::string clanguml::common::get_tag_name (const clang::TagDecl &declaration)
 Generate full qualified name for clang::TagDecl instance.
 
template<typename T >
std::string clanguml::common::get_qualified_name (const T &declaration)
 Get qualified name of some Clang declaration.
 
model::namespace_ clanguml::common::get_tag_namespace (const clang::TagDecl &declaration)
 
model::namespace_ clanguml::common::get_template_namespace (const clang::TemplateDecl &declaration)
 
std::string clanguml::common::to_string (const clang::QualType &type, const clang::ASTContext &ctx, bool try_canonical)
 
std::string clanguml::common::to_string (const clang::RecordType &type, const clang::ASTContext &ctx, bool try_canonical)
 
std::string clanguml::common::to_string (const clang::TemplateArgument &arg, const clang::ASTContext *ctx)
 
std::string clanguml::common::to_string (const clang::Expr *expr)
 
std::string clanguml::common::to_string (const clang::ValueDecl *val)
 
std::string clanguml::common::to_string (const clang::Stmt *stmt)
 
std::string clanguml::common::to_string (const clang::FunctionTemplateDecl *decl)
 
std::string clanguml::common::to_string (const clang::TypeConstraint *tc)
 
std::string clanguml::common::to_string (const clang::TemplateName &templ)
 
std::string clanguml::common::get_source_text_raw (clang::SourceRange range, const clang::SourceManager &sm)
 Get raw text of specific source range.
 
std::string clanguml::common::get_source_text (clang::SourceRange range, const clang::SourceManager &sm)
 Get printable range of text of specific source range.
 
std::tuple< unsigned int, unsigned int, std::string > clanguml::common::extract_template_parameter_index (const std::string &type_parameter)
 Extract template depth and index.
 
void clanguml::common::ensure_lambda_type_is_relative (const config::diagram &config, std::string &parameter_type)
 
bool clanguml::common::is_subexpr_of (const clang::Stmt *parent_stmt, const clang::Stmt *sub_stmt)
 Check if an expression is contained in another expression.
 
template<typename T >
eid_t clanguml::common::to_id (const T &declaration)
 
template<>
eid_t clanguml::common::to_id (const std::string &full_name)
 
eid_t clanguml::common::to_id (const clang::QualType &type, const clang::ASTContext &ctx)
 
template<>
eid_t clanguml::common::to_id (const clang::NamespaceDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::CXXRecordDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::RecordDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::EnumDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::TagDecl &declaration)
 
template<>
eid_t clanguml::common::to_id (const clang::EnumType &type)
 
template<>
eid_t clanguml::common::to_id (const clang::TemplateSpecializationType &type)
 
template<>
eid_t clanguml::common::to_id (const std::filesystem::path &type)
 
std::pair< common::model::namespace_, std::string > clanguml::common::split_ns (const std::string &full_name)
 Split qualified name to namespace and name.
 
std::vector< common::model::template_parameterclanguml::common::parse_unexposed_template_params (const std::string &params, const std::function< std::string(const std::string &)> &ns_resolve, int depth=0)
 Parse unexposed (available as string) template params.
 
std::vector< std::string > clanguml::common::tokenize_unexposed_template_parameter (const std::string &t)
 
template<typename T , typename P , typename F >
void clanguml::common::if_dyn_cast (P pointer, F &&func)
 
bool clanguml::common::parse_source_location (const std::string &location_str, std::string &file, unsigned &line, unsigned &column)
 
bool clanguml::common::is_type_parameter (const std::string &t)
 
bool clanguml::common::is_qualifier (const std::string &q)
 
bool clanguml::common::is_bracket (const std::string &b)
 
bool clanguml::common::is_identifier_character (char c)
 
bool clanguml::common::is_identifier (const std::string &t)
 
bool clanguml::common::is_qualified_identifier (const std::string &t)
 
bool clanguml::common::is_type_token (const std::string &t)
 
std::string clanguml::common::format_condition_text (const std::string &condition_text)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::IfStmt *stmt)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::WhileStmt *stmt)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::CXXForRangeStmt *stmt)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::ForStmt *stmt)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::DoStmt *stmt)
 
std::string clanguml::common::get_condition_text (clang::SourceManager &sm, clang::ConditionalOperator *stmt)
 
clang::QualType clanguml::common::dereference (clang::QualType type)
 
std::pair< clang::QualType, std::deque< common::model::context > > clanguml::common::consume_type_context (clang::QualType type)
 Extract type context and return raw type.
 
clang::RawComment * clanguml::common::get_expression_raw_comment (const clang::SourceManager &sm, const clang::ASTContext &context, const clang::Stmt *stmt)
 Extract a comment before or next to a statement.
 
clang::RawComment * clanguml::common::get_declaration_raw_comment (const clang::SourceManager &sm, const clang::ASTContext &context, const clang::Decl *decl)
 
clang::RawComment * clanguml::common::get_raw_comment (const clang::SourceManager &sm, const clang::ASTContext &context, const clang::SourceRange &source_range)
 
bool clanguml::common::is_coroutine (const clang::FunctionDecl &decl)
 
bool clanguml::common::is_struct (const clang::NamedDecl *decl)
 
bool clanguml::common::has_attr (const clang::FunctionDecl *decl, clang::attr::Kind function_attr)
 
std::optional< size_t > clanguml::common::get_array_size (const clang::ArrayType &type)