KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kigit_ignore.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 KIGIT_IGNORE_H_
21#define KIGIT_IGNORE_H_
22
23#include <import_export.h>
24
25#include <vector>
26
27#include <wx/filename.h>
28#include <wx/string.h>
29
30class KIGIT_COMMON;
31
32namespace KIGIT
33{
34
37{
39 bool ignored = false;
40
42 bool tracked = false;
43};
44
45
48APIEXPORT wxFileName ProjectIgnoreFile( const wxString& aProjectPath );
49
56APIEXPORT wxString PathIgnoreRule( const wxString& aProjectRelPath, bool aIsDirectory );
57
59APIEXPORT wxString ExtensionIgnoreRule( const wxString& aProjectRelPath );
60
62APIEXPORT std::vector<wxString> ReadIgnoreRules( const wxFileName& aIgnoreFile );
63
66APIEXPORT bool AddIgnoreRules( const wxFileName& aIgnoreFile, const std::vector<wxString>& aRules,
67 const wxString& aHeader, wxString& aError );
68
71APIEXPORT bool RemoveIgnoreRules( const wxFileName& aIgnoreFile, const std::vector<wxString>& aRules,
72 wxString& aError );
73
81APIEXPORT IGNORE_STATE IgnoreState( KIGIT_COMMON& aCommon, const wxString& aProjectRelPath, bool aIsDirectory );
82
83} // namespace KIGIT
84
85#endif // KIGIT_IGNORE_H_
The project's git session.
#define APIEXPORT
Macros which export functions from a DLL/DSO.
APIEXPORT bool AddIgnoreRules(const wxFileName &aIgnoreFile, const std::vector< wxString > &aRules, const wxString &aHeader, wxString &aError)
Append rules to an ignore file, creating it with aHeader as a comment when it is not there.
APIEXPORT wxFileName ProjectIgnoreFile(const wxString &aProjectPath)
The ignore file that covers a project.
APIEXPORT bool RemoveIgnoreRules(const wxFileName &aIgnoreFile, const std::vector< wxString > &aRules, wxString &aError)
Remove rules from an ignore file.
APIEXPORT wxString ExtensionIgnoreRule(const wxString &aProjectRelPath)
The rule that ignores every file sharing a path's extension, or nothing when it has none.
APIEXPORT IGNORE_STATE IgnoreState(KIGIT_COMMON &aCommon, const wxString &aProjectRelPath, bool aIsDirectory)
What git's rules and its index say about a project path, so the user is offered only what would take ...
APIEXPORT wxString PathIgnoreRule(const wxString &aProjectRelPath, bool aIsDirectory)
The rule that ignores one path and nothing else.
APIEXPORT std::vector< wxString > ReadIgnoreRules(const wxFileName &aIgnoreFile)
The rules an ignore file holds, in order, without its comments and blank lines.
What an ignore rule for one path would achieve.
bool tracked
The path, or a file inside it, is in the index, so a new rule would do nothing.
bool ignored
Git's rules already cover the path.