KiCad PCB EDA Suite
Loading...
Searching...
No Matches
report_severity.cpp
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#include <
widgets/report_severity.h
>
21
#include <
i18n_utility.h
>
22
#include <vector>
23
#include <wx/arrstr.h>
// for MSVC to see std::vector<wxString> is exported from wx
24
25
26
wxString
formatSeverities
(
int
aSeverities )
27
{
28
wxString
result
;
29
std::vector<wxString> items;
30
31
if
( aSeverities &
RPT_SEVERITY_ERROR
)
32
items.push_back( wxS(
"Errors"
) );
33
34
if
( aSeverities &
RPT_SEVERITY_WARNING
)
35
items.push_back( wxS(
"Warnings"
) );
36
37
if
( aSeverities &
RPT_SEVERITY_EXCLUSION
)
38
items.push_back( wxS(
"Exclusions"
) );
39
40
if
( items.empty() )
41
return
wxS(
"None"
);
42
43
for
(
size_t
i = 0; i < items.size(); i++ )
44
{
45
result
+= items[i];
46
47
if
( i < items.size() - 1 )
48
result
+= wxS(
", "
);
49
}
50
51
return
result
;
52
}
53
i18n_utility.h
Some functions to handle hotkeys in KiCad.
formatSeverities
wxString formatSeverities(int aSeverities)
Convert a severity mask to a human-readable comma-separated string.
Definition
report_severity.cpp:26
report_severity.h
RPT_SEVERITY_WARNING
@ RPT_SEVERITY_WARNING
Definition
report_severity.h:34
RPT_SEVERITY_ERROR
@ RPT_SEVERITY_ERROR
Definition
report_severity.h:35
RPT_SEVERITY_EXCLUSION
@ RPT_SEVERITY_EXCLUSION
Definition
report_severity.h:32
result
wxString result
Test unit parsing edge cases and error handling.
Definition
test_text_eval_numeric_compat.cpp:602
src
common
widgets
report_severity.cpp
Generated on Sat Dec 13 2025 00:06:17 for KiCad PCB EDA Suite by
1.13.2