siplasplas
A library for C++ reflection and introspection
cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line > Class Template Reference

Stores source information of an entity. More...

#include <siplasplas/reflection/static/sourceinfo.hpp>

Static Public Member Functions

static constexpr static_reflection::Kind kind ()
 Retrns the kind (category) of the entity. More...
 
static constexpr const char * fullName ()
 Returns the full qualified name of an entity. More...
 
static constexpr const char * spelling ()
 Returns the name of the entity See clang_getCursorSpelling(). More...
 
static constexpr const char * displayName ()
 Returns the display name of the entity. More...
 
static constexpr const char * file ()
 Returns the full path to the file where the entity is declared. More...
 
static constexpr std::size_t line ()
 Returns the line number where the entity is declared.
 

Detailed Description

template<static_reflection::Kind Kind, typename FullName, typename Spelling, typename DisplayName, typename File, std::size_t Line>
class cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >

Stores source information of an entity.

SourceInfo class stores information about the declaration of an entity (class, function, etc) in the context of the sourcecode where the entity is declared. This information includes the file where the entity is declared, the line, the name of the entity, etc.

Member Function Documentation

template<static_reflection::Kind Kind, typename FullName , typename Spelling , typename DisplayName , typename File , std::size_t Line>
static constexpr const char* cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >::displayName ( )
inlinestatic

Returns the display name of the entity.

The display name contains extra information that helps identify the entity, such as the parameters of a function or template or the arguments of a class template specialization.

See clang_getCursorDisplayName()

Returns
a pointer to a null-terminated constexpr C string with the display name. If the source info is a default empty source info (Such as from an entity without reflection metadata available) returns an empty string.
template<static_reflection::Kind Kind, typename FullName , typename Spelling , typename DisplayName , typename File , std::size_t Line>
static constexpr const char* cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >::file ( )
inlinestatic

Returns the full path to the file where the entity is declared.

The path returned is the full path to the declaration file of the entity as read when the file was processed by DRLParser. This full path may change if the user sources are deployed to a different path/machine, so user code should not rely in this full path. However, depending on the structure of the user project, a relative path to the user source tree or include tree may be get from this path

Returns
a pointer to a null-terminated constexpr C string with the full path. If the source info is a default empty source info (Such as from an entity without reflection metadata available) returns an empty string.
template<static_reflection::Kind Kind, typename FullName , typename Spelling , typename DisplayName , typename File , std::size_t Line>
static constexpr const char* cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >::fullName ( )
inlinestatic

Returns the full qualified name of an entity.

Returns
a pointer to a null-terminated constexpr C string with the full name. If the source info is a default empty source info (Such as from an entity without reflection metadata available) returns an empty string.
template<static_reflection::Kind Kind, typename FullName , typename Spelling , typename DisplayName , typename File , std::size_t Line>
static constexpr static_reflection::Kind cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >::kind ( )
inlinestatic

Retrns the kind (category) of the entity.

template<static_reflection::Kind Kind, typename FullName , typename Spelling , typename DisplayName , typename File , std::size_t Line>
static constexpr const char* cpp::static_reflection::meta::SourceInfo< Kind, FullName, Spelling, DisplayName, File, Line >::spelling ( )
inlinestatic

Returns the name of the entity See clang_getCursorSpelling().

Returns
a pointer to a null-terminated constexpr C string with the spelling. If the source info is a default empty source info (Such as from an entity without reflection metadata available) returns an empty string.

The documentation for this class was generated from the following file: