Debian Codegraph @

cppchecker/cppcheck_settings.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : cppcheck_settings.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #ifndef __cppcheckjob__
27 #define __cppcheckjob__
28
29 #include "macros.h"
30 #include "project.h"
31 #include "serialized_object.h"
32
33 // Define the events needed by this job
34 extern const wxEventType wxEVT_CPPCHECKJOB_STATUS_MESSAGE;
35 extern const wxEventType wxEVT_CPPCHECKJOB_CHECK_COMPLETED;
36 extern const wxEventType wxEVT_CPPCHECKJOB_REPORT;
37
38 class IPlugin;
39 class wxCheckListBox;
40
41 class CppCheckSettings : public SerializedObject
42 {
43 bool m_Style;
44 bool m_Performance;
45 bool m_Portability;
46 bool m_UnusedFunctions;
47 bool m_MissingIncludes;
48 bool m_Information;
49 bool m_PosixStandards;
50 bool m_C99Standards;
51 bool m_Cpp11Standards;
52 bool m_Force;
53 int m_Jobs;
54 bool m_CheckConfig;
55 wxArrayString m_excludeFiles;
56 wxStringMap_t m_SuppressedWarnings0; // The items unchecked in the checklistbox
57 wxStringMap_t m_SuppressedWarnings1; // The checked ones
58 wxStringMap_t m_SuppressedWarningsOrig0; // Ditto, containing the original values
59 wxStringMap_t m_SuppressedWarningsOrig1;
60 bool m_saveSuppressedWarnings;
61 wxArrayString m_IncludeDirs;
62 bool m_SuppressSystemIncludes;
63 bool m_saveIncludeDirs;
64 wxArrayString m_definitions;
65 wxArrayString m_undefines;
66
67 public:
68 CppCheckSettings();
69
70 bool GetStyle() const { return m_Style; }
71 bool GetPerformance() const { return m_Performance; }
72 bool GetPortability() const { return m_Portability; }
73 bool GetUnusedFunctions() const { return m_UnusedFunctions; }
74 bool GetMissingIncludes() const { return m_MissingIncludes; }
75 bool GetInformation() const { return m_Information; }
76 bool GetPosixStandards() const { return m_PosixStandards; }
77 bool GetC99Standards() const { return m_C99Standards; }
78 bool GetCpp11Standards() const { return m_Cpp11Standards; }
79 bool GetForce() const { return m_Force; }
80 int GetJobs() const { return m_Jobs; }
81 bool GetCheckConfig() const { return m_CheckConfig; }
82 const wxArrayString& GetExcludeFiles() const { return m_excludeFiles; }
83 const wxStringMap_t* GetSuppressedWarningsStrings0() const { return &m_SuppressedWarnings0; }
84 const wxStringMap_t* GetSuppressedWarningsStrings1() const { return &m_SuppressedWarnings1; }
85 const wxArrayString& GetIncludeDirs() const { return m_IncludeDirs; }
86 bool GetSuppressSystemIncludes() const { return m_SuppressSystemIncludes; }
87 bool GetSaveIncludeDirs() const { return m_saveIncludeDirs; }
88 const wxArrayString& GetDefinitions() const { return m_definitions; }
89 const wxArrayString& GetUndefines() const { return m_undefines; }
90
91 void SetStyle(bool Style) { m_Style = Style; }
92 void SetPerformance(bool Performance) { m_Performance = Performance; }
93 void SetPortability(bool Portability) { m_Portability = Portability; }
94 void SetUnusedFunctions(bool UnusedFunctions) { m_UnusedFunctions = UnusedFunctions; }
95 void SetMissingIncludes(bool MissingIncludes) { m_MissingIncludes = MissingIncludes; }
96 void SetInformation(bool Information) { m_Information = Information; }
97 void SetPosixStandards(bool PosixStandards) { m_PosixStandards = PosixStandards; }
98 void SetC99Standards(bool C99Standards) { m_C99Standards = C99Standards; }
99 void SetCpp11Standards(bool Cpp11Standards) { m_Cpp11Standards = Cpp11Standards; }
100 void SetForce(bool Force) { m_Force = Force; }
101 void SetJobs(int jobs) { m_Jobs = jobs; }
102 void SetCheckConfig(bool checkconfig) { m_CheckConfig = checkconfig; }
103 void SetExcludeFiles(const wxArrayString& excludeFiles) { m_excludeFiles = excludeFiles; }
104 void AddSuppressedWarning(const wxString& key, const wxString& label, bool checked);
105 void RemoveSuppressedWarning(const wxString& key);
106 void SetSuppressedWarnings(wxCheckListBox* clb, const wxArrayString& keys);
107 void SetSaveSuppressedWarnings(bool save) { m_saveSuppressedWarnings = save; }
108 void SetDefaultSuppressedWarnings();
109
110 void SetIncludeDirs(const wxArrayString& dirs) { m_IncludeDirs = dirs; }
111 void SetSuppressSystemIncludes(bool suppress) { m_SuppressSystemIncludes = suppress; }
112 void SetSaveIncludeDirs(bool save) { m_saveIncludeDirs = save; }
113
114 void SetDefinitions(const wxArrayString& definitions) { m_definitions = definitions; }
115 void SetUndefines(const wxArrayString& undefines) { m_undefines = undefines; }
116
117 virtual void Serialize(Archive& arch);
118 virtual void DeSerialize(Archive& arch);
119
120 wxString GetOptions() const;
121 void LoadProjectSpecificSettings(ProjectPtr proj);
122 };
123
124 #endif // __cppcheckjob__