Skip to content

Commit 8788300

Browse files
committed
chore: improved file paths
1 parent 2b5c5c8 commit 8788300

33 files changed

+393
-222
lines changed

include/mrdocs/Metadata/Source.hpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,46 @@
2222
namespace clang {
2323
namespace mrdocs {
2424

25+
enum class FileKind
26+
{
27+
// file in the source directory
28+
Source,
29+
// file in a system include directory
30+
System,
31+
// file outside the source directory
32+
Other
33+
};
34+
2535
struct MRDOCS_DECL
2636
Location
2737
{
38+
/** The full file path
39+
*/
40+
std::string Path;
41+
2842
/** Name of the file
2943
*/
3044
std::string Filename;
3145

3246
/** Line number within the file
3347
*/
34-
unsigned LineNumber;
48+
unsigned LineNumber = 0;
3549

36-
/** Whether the file is inside the source root directory
50+
/** The kind of file this is
3751
*/
38-
bool IsFileInRootDir;
52+
FileKind Kind = FileKind::Source;
3953

4054
//--------------------------------------------
4155

4256
Location(
43-
unsigned line = 0,
57+
std::string_view filepath = "",
4458
std::string_view filename = "",
45-
bool in_root_dir = false)
46-
: Filename(filename)
59+
unsigned line = 0,
60+
FileKind kind = FileKind::Source)
61+
: Path(filepath)
62+
, Filename(filename)
4763
, LineNumber(line)
48-
, IsFileInRootDir(in_root_dir)
64+
, Kind(kind)
4965
{
5066
}
5167
};

0 commit comments

Comments
 (0)