KiCad PCB EDA Suite
Loading...
Searching...
No Matches
column_formatter.h
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
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <wx/string.h>
23
24
#include <
reporter.h
>
25
#include <
units_provider.h
>
26
27
28
class
COLUMN_FORMATTER
29
{
30
public
:
31
enum class
BOOL_FORMAT
32
{
33
ZERO_ONE
,
34
TRUE_FALSE
,
35
};
36
37
virtual
~COLUMN_FORMATTER
() =
default
;
38
39
COLUMN_FORMATTER
(
UNITS_PROVIDER
& aUnitsProvider,
bool
aIncludeUnits,
BOOL_FORMAT
aBoolFormat,
40
REPORTER
& aReporter ) :
41
m_unitsProvider
( aUnitsProvider ),
42
m_includeUnits
( aIncludeUnits ),
43
m_boolFormat
( aBoolFormat ),
44
m_reporter
( aReporter )
45
{
46
}
47
48
protected
:
49
wxString
stringFromBool
(
bool
aValue )
const
;
50
51
bool
boolFromString
(
const
wxString& aValue,
REPORTER
& aReporter )
const
;
52
53
UNITS_PROVIDER
&
m_unitsProvider
;
54
bool
m_includeUnits
;
55
BOOL_FORMAT
m_boolFormat
;
56
REPORTER
&
m_reporter
;
57
};
58
59
63
bool
MatchTranslationOrNative
(
const
wxString& aStr,
const
wxString& aNativeLabel,
bool
aCaseSensitive );
COLUMN_FORMATTER::COLUMN_FORMATTER
COLUMN_FORMATTER(UNITS_PROVIDER &aUnitsProvider, bool aIncludeUnits, BOOL_FORMAT aBoolFormat, REPORTER &aReporter)
Definition
column_formatter.h:39
COLUMN_FORMATTER::m_reporter
REPORTER & m_reporter
Definition
column_formatter.h:56
COLUMN_FORMATTER::m_boolFormat
BOOL_FORMAT m_boolFormat
Definition
column_formatter.h:55
COLUMN_FORMATTER::stringFromBool
wxString stringFromBool(bool aValue) const
Definition
column_formatter.cpp:38
COLUMN_FORMATTER::boolFromString
bool boolFromString(const wxString &aValue, REPORTER &aReporter) const
Definition
column_formatter.cpp:54
COLUMN_FORMATTER::~COLUMN_FORMATTER
virtual ~COLUMN_FORMATTER()=default
COLUMN_FORMATTER::m_includeUnits
bool m_includeUnits
Definition
column_formatter.h:54
COLUMN_FORMATTER::BOOL_FORMAT
BOOL_FORMAT
Definition
column_formatter.h:32
COLUMN_FORMATTER::BOOL_FORMAT::ZERO_ONE
@ ZERO_ONE
Definition
column_formatter.h:33
COLUMN_FORMATTER::BOOL_FORMAT::TRUE_FALSE
@ TRUE_FALSE
Definition
column_formatter.h:34
COLUMN_FORMATTER::m_unitsProvider
UNITS_PROVIDER & m_unitsProvider
Definition
column_formatter.h:53
REPORTER
A pure virtual class used to derive REPORTER objects from.
Definition
reporter.h:73
UNITS_PROVIDER
Definition
units_provider.h:31
MatchTranslationOrNative
bool MatchTranslationOrNative(const wxString &aStr, const wxString &aNativeLabel, bool aCaseSensitive)
Return true if the given string matches either the translated or native version of the given label.
Definition
column_formatter.cpp:31
reporter.h
units_provider.h
src
include
column_formatter.h
Generated on Thu Sep 17 2026 00:06:16 for KiCad PCB EDA Suite by
1.13.2