File tree Expand file tree Collapse file tree 20 files changed +103
-118
lines changed Expand file tree Collapse file tree 20 files changed +103
-118
lines changed Original file line number Diff line number Diff line change 23
23
#include < mrdox/Metadata/Info.hpp>
24
24
#include < mrdox/Metadata/Interface.hpp>
25
25
#include < mrdox/Metadata/Javadoc.hpp>
26
- #include < mrdox/Metadata/Location.hpp>
27
26
#include < mrdox/Metadata/Namespace.hpp>
28
27
#include < mrdox/Metadata/Overloads.hpp>
29
28
#include < mrdox/Metadata/Record.hpp>
30
29
#include < mrdox/Metadata/Specialization.hpp>
31
- #include < mrdox/Metadata/Symbol .hpp>
30
+ #include < mrdox/Metadata/Source .hpp>
32
31
#include < mrdox/Metadata/Symbols.hpp>
33
32
#include < mrdox/Metadata/Template.hpp>
34
33
#include < mrdox/Metadata/Type.hpp>
Original file line number Diff line number Diff line change 14
14
15
15
#include < mrdox/Platform.hpp>
16
16
#include < mrdox/Metadata/Javadoc.hpp>
17
- #include < mrdox/Metadata/Symbol .hpp>
17
+ #include < mrdox/Metadata/Source .hpp>
18
18
#include < mrdox/Metadata/Type.hpp>
19
19
#include < optional>
20
20
#include < string>
@@ -63,7 +63,7 @@ struct EnumValueInfo
63
63
// Info for types.
64
64
struct EnumInfo
65
65
: IsInfo<InfoKind::Enum>
66
- , SymbolInfo
66
+ , SourceInfo
67
67
{
68
68
// Indicates whether this enum is scoped (e.g. enum class).
69
69
bool Scoped = false ;
Original file line number Diff line number Diff line change 15
15
16
16
#include < mrdox/Platform.hpp>
17
17
#include < mrdox/Metadata/Info.hpp>
18
- #include < mrdox/Metadata/Symbol .hpp>
18
+ #include < mrdox/Metadata/Source .hpp>
19
19
#include < mrdox/Metadata/Type.hpp>
20
20
#include < mrdox/ADT/BitField.hpp>
21
21
#include < utility>
@@ -40,7 +40,7 @@ union FieldFlags
40
40
*/
41
41
struct FieldInfo
42
42
: IsInfo<InfoKind::Field>
43
- , SymbolInfo
43
+ , SourceInfo
44
44
{
45
45
/* * Type of the field */
46
46
TypeInfo Type;
Original file line number Diff line number Diff line change 16
16
#include < mrdox/Platform.hpp>
17
17
#include < mrdox/ADT/BitField.hpp>
18
18
#include < mrdox/Metadata/Field.hpp>
19
- #include < mrdox/Metadata/Symbol .hpp>
19
+ #include < mrdox/Metadata/Source .hpp>
20
20
#include < mrdox/Metadata/Symbols.hpp>
21
21
#include < mrdox/Metadata/Template.hpp>
22
22
#include < clang/AST/Attr.h>
@@ -176,7 +176,7 @@ struct Param
176
176
// Info for functions.
177
177
struct FunctionInfo
178
178
: IsInfo<InfoKind::Function>
179
- , SymbolInfo
179
+ , SourceInfo
180
180
{
181
181
friend class ASTVisitor ;
182
182
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 17
17
#include < mrdox/Metadata/Enum.hpp>
18
18
#include < mrdox/Metadata/Field.hpp>
19
19
#include < mrdox/Metadata/Function.hpp>
20
- #include < mrdox/Metadata/Symbol .hpp>
20
+ #include < mrdox/Metadata/Source .hpp>
21
21
#include < mrdox/Metadata/Symbols.hpp>
22
22
#include < mrdox/Metadata/Template.hpp>
23
23
#include < mrdox/Metadata/Typedef.hpp>
@@ -73,7 +73,7 @@ enum class RecordKeyKind
73
73
*/
74
74
struct RecordInfo
75
75
: IsInfo<InfoKind::Record>
76
- , SymbolInfo
76
+ , SourceInfo
77
77
{
78
78
friend class ASTVisitor ;
79
79
Original file line number Diff line number Diff line change 10
10
// Official repository: https://github.com/cppalliance/mrdox
11
11
//
12
12
13
- #ifndef MRDOX_API_METADATA_SYMBOL_HPP
14
- #define MRDOX_API_METADATA_SYMBOL_HPP
13
+ #ifndef MRDOX_API_METADATA_SOURCE_HPP
14
+ #define MRDOX_API_METADATA_SOURCE_HPP
15
15
16
16
#include < mrdox/Platform.hpp>
17
17
#include < mrdox/Metadata/Info.hpp>
18
- #include < mrdox/Metadata/Location.hpp>
19
18
#include < optional>
19
+ #include < string>
20
+ #include < string_view>
20
21
21
22
namespace clang {
22
23
namespace mrdox {
23
24
24
- /* * Base class for Info that have source locations.
25
+ struct Location
26
+ {
27
+ /* * Name of the file
28
+ */
29
+ std::string Filename;
30
+
31
+ /* * Line number within the file
32
+ */
33
+ int LineNumber;
34
+
35
+ /* * Whether the file is inside the source root directory
36
+ */
37
+ bool IsFileInRootDir;
38
+
39
+ // --------------------------------------------
40
+
41
+ Location (
42
+ int line = 0 ,
43
+ std::string_view filename = " " ,
44
+ bool in_root_dir = false )
45
+ : Filename(filename)
46
+ , LineNumber(line)
47
+ , IsFileInRootDir(in_root_dir)
48
+ {
49
+ }
50
+ };
51
+
52
+ /* * Stores source information for a declaration.
25
53
*/
26
- struct SymbolInfo
54
+ struct SourceInfo
27
55
{
28
56
/* * Location where the entity was defined
29
57
@@ -41,7 +69,7 @@ struct SymbolInfo
41
69
std::vector<Location> Loc;
42
70
43
71
protected:
44
- SymbolInfo () = default ;
72
+ SourceInfo () = default ;
45
73
};
46
74
47
75
} // mrdox
Original file line number Diff line number Diff line change 14
14
#define MRDOX_API_METADATA_TYPEDEF_HPP
15
15
16
16
#include < mrdox/Platform.hpp>
17
- #include < mrdox/Metadata/Symbol .hpp>
17
+ #include < mrdox/Metadata/Source .hpp>
18
18
#include < mrdox/Metadata/Template.hpp>
19
19
#include < mrdox/Metadata/Type.hpp>
20
20
#include < memory>
@@ -25,7 +25,7 @@ namespace mrdox {
25
25
// Info for typedef and using statements.
26
26
struct TypedefInfo
27
27
: IsInfo<InfoKind::Typedef>
28
- , SymbolInfo
28
+ , SourceInfo
29
29
{
30
30
friend class ASTVisitor ;
31
31
Original file line number Diff line number Diff line change 14
14
15
15
#include < mrdox/Platform.hpp>
16
16
#include < mrdox/ADT/BitField.hpp>
17
- #include < mrdox/Metadata/Symbol .hpp>
17
+ #include < mrdox/Metadata/Source .hpp>
18
18
#include < mrdox/Metadata/Template.hpp>
19
19
#include < mrdox/Metadata/Type.hpp>
20
20
#include < clang/Basic/Specifiers.h>
@@ -37,7 +37,7 @@ union VariableFlags0
37
37
*/
38
38
struct VariableInfo
39
39
: IsInfo<InfoKind::Variable>
40
- , SymbolInfo
40
+ , SourceInfo
41
41
{
42
42
friend class ASTVisitor ;
43
43
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ struct RecordInfo;
41
41
struct Param ;
42
42
struct SpecializationInfo ;
43
43
struct SpecializedMember ;
44
- struct SymbolInfo ;
44
+ struct SourceInfo ;
45
45
struct TypeInfo ;
46
46
struct TypedefInfo ;
47
47
struct VariableInfo ;
You can’t perform that action at this time.
0 commit comments