-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved reporting with levels
1 parent
0365b23
commit 9a64659
Showing
19 changed files
with
771 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
// Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdox | ||
// | ||
|
||
/* | ||
This file goes in the root of a repository. We | ||
use the C++ source_location information in order | ||
to the full path to the repository, so that we | ||
can strip this prefix later and generate pretty | ||
source filenames for diagnostic output. | ||
*/ | ||
|
||
namespace SourceFileNames { | ||
|
||
char const* | ||
getFileName(char const* fileName) noexcept | ||
{ | ||
auto it = fileName; | ||
auto it0 = fileName; | ||
auto it1 = __FILE__; | ||
while(*it0 && *it1) | ||
{ | ||
if(*it0 != *it1) | ||
break; | ||
#ifdef _WIN32 | ||
if(*it0++ == '\\') | ||
it = it0; | ||
#else | ||
if(*it0++ == '/') | ||
it = it0; | ||
#endif | ||
++it1; | ||
} | ||
return it; | ||
} | ||
|
||
} // SourceFileNames | ||
|
Oops, something went wrong.