KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_git_errors.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 3
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#ifndef KICAD_GIT_ERRORS_H
21#define KICAD_GIT_ERRORS_H
22
23#include <vector>
24#include <import_export.h>
25
26#include <wx/translation.h>
27
29{
30public:
31
32 KIGIT_ERRORS() = default;
33 virtual ~KIGIT_ERRORS() = default;
34
35 const std::vector<wxString>& GetErrorStrings() const
36 {
37 return m_errorStrings;
38 }
39
40 wxString PeekErrorString() const
41 {
42 if( m_errorStrings.empty() )
43 return _( "No error" );
44 else
45 return m_errorStrings.back();
46 }
47
48 wxString GetErrorString()
49 {
50 if( m_errorStrings.empty() )
51 return _( "No error" );
52
53 const wxString errorString( m_errorStrings.back() );
54 m_errorStrings.pop_back();
55 return errorString;
56 }
57
58 void AddErrorString( const wxString aErrorString )
59 {
60 m_errorStrings.emplace_back( aErrorString );
61 }
62
63 void AddErrorString( const std::string aErrorString )
64 {
65 m_errorStrings.emplace_back( aErrorString );
66 }
67
69 {
70 m_errorStrings.clear();
71 }
72
73private:
74
75 std::vector<wxString> m_errorStrings;
76
77};
78
79#endif // KICAD_GIT_ERRORS_H
wxString PeekErrorString() const
virtual ~KIGIT_ERRORS()=default
const std::vector< wxString > & GetErrorStrings() const
void AddErrorString(const wxString aErrorString)
wxString GetErrorString()
KIGIT_ERRORS()=default
void ClearErrorStrings()
void AddErrorString(const std::string aErrorString)
std::vector< wxString > m_errorStrings
#define _(s)
#define APIEXPORT
Macros which export functions from a DLL/DSO.