Cppcheck
projectfile.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2024 Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PROJECT_FILE_H
20 #define PROJECT_FILE_H
21 
22 #include "settings.h"
23 #include "suppressions.h"
24 
25 #include <cstddef>
26 #include <map>
27 #include <utility>
28 
29 #include <QList>
30 #include <QObject>
31 #include <QString>
32 #include <QStringList>
33 
34 class QXmlStreamReader;
35 class QXmlStreamWriter;
36 
37 /// @addtogroup GUI
38 /// @{
39 
40 
41 /**
42  * @brief A class that reads and writes project files.
43  * The project files contain project-specific settings for checking. For
44  * example a list of include paths.
45  */
46 class ProjectFile : public QObject {
47  Q_OBJECT
48 
49 public:
50  explicit ProjectFile(QObject *parent = nullptr);
51  explicit ProjectFile(QString filename, QObject *parent = nullptr);
52  ~ProjectFile() override {
53  if (this == mActiveProject) mActiveProject = nullptr;
54  }
55 
56  enum class CheckLevel {
57  normal,
59  };
60 
62  return mActiveProject;
63  }
65  mActiveProject = this;
66  }
67 
68  /**
69  * @brief Read the project file.
70  * @param filename Filename (can be also given to constructor).
71  */
72  bool read(const QString &filename = QString());
73 
74  /**
75  * @brief Get project root path.
76  * @return project root path.
77  */
78  const QString& getRootPath() const {
79  return mRootPath;
80  }
81 
82  const QString& getBuildDir() const {
83  return mBuildDir;
84  }
85 
86  const QString& getImportProject() const {
87  return mImportProject;
88  }
89 
90  bool getAnalyzeAllVsConfigs() const {
91  return mAnalyzeAllVsConfigs;
92  }
93 
94  bool getCheckHeaders() const {
95  return mCheckHeaders;
96  }
97 
98  void setCheckHeaders(bool b) {
99  mCheckHeaders = b;
100  }
101 
102  bool getCheckUnusedTemplates() const {
103  return mCheckUnusedTemplates;
104  }
105 
106  void setCheckUnusedTemplates(bool b) {
108  }
109 
110  /**
111  * @brief Get list of include directories.
112  * @return list of directories.
113  */
114  QStringList getIncludeDirs() const {
116  }
117 
118  /**
119  * @brief Get list of defines.
120  * @return list of defines.
121  */
122  const QStringList& getDefines() const {
123  return mDefines;
124  }
125 
126  /**
127  * @brief Get list of undefines.
128  * @return list of undefines.
129  */
130  const QStringList& getUndefines() const {
131  return mUndefines;
132  }
133 
134  /**
135  * @brief Get list of paths to check.
136  * @return list of paths.
137  */
138  QStringList getCheckPaths() const {
140  }
141 
142  /**
143  * @brief Get list of paths to exclude from the check.
144  * @return list of paths.
145  */
146  QStringList getExcludedPaths() const {
148  }
149 
150  /**
151  * @brief Get list of paths to exclude from the check.
152  * @return list of paths.
153  */
154  const QStringList& getVsConfigurations() const {
155  return mVsConfigurations;
156  }
157 
158  /**
159  * @brief Get list libraries.
160  * @return list of libraries.
161  */
162  const QStringList& getLibraries() const {
163  return mLibraries;
164  }
165 
166  /**
167  * @brief Get platform.
168  * @return Current platform. If it ends with .xml then it is a file. Otherwise it must match one of the return values from @sa cppcheck::Platform::toString() ("win32A", "unix32", ..)
169  */
170  const QString& getPlatform() const {
171  return mPlatform;
172  }
173 
174  const QString& getProjectName() const {
175  return mProjectName;
176  }
177 
178  void setProjectName(QString projectName) {
179  mProjectName = std::move(projectName);
180  }
181 
182  /**
183  * @brief Get "raw" suppressions.
184  * @return list of suppressions.
185  */
186  const QList<SuppressionList::Suppression>& getSuppressions() const {
187  return mSuppressions;
188  }
189 
190  /**
191  * @brief Get "checking" suppressions. Relative paths are converted to absolute paths.
192  * @return list of suppressions.
193  */
194  QList<SuppressionList::Suppression> getCheckingSuppressions() const;
195 
196  /**
197  * @brief Get list addons.
198  * @return list of addons.
199  */
200  const QStringList& getAddons() const {
201  return mAddons;
202  }
203 
204  /**
205  * @brief Get path to addon python script
206  * @param filesDir Data files folder set by --data-dir
207  * @param addon addon i.e. "misra" to lookup
208  */
209  static QString getAddonFilePath(QString filesDir, const QString &addon);
210 
211  /**
212  * @brief Get list of addons and tools.
213  * @return list of addons and tools.
214  */
215  QStringList getAddonsAndTools() const;
216 
217  bool getClangAnalyzer() const {
218  return false; //mClangAnalyzer;
219  }
220 
221  void setClangAnalyzer(bool c) {
222  mClangAnalyzer = c;
223  }
224 
225  bool getClangTidy() const {
226  return mClangTidy;
227  }
228 
229  void setClangTidy(bool c) {
230  mClangTidy = c;
231  }
232 
233  const QStringList& getTags() const {
234  return mTags;
235  }
236 
237  int getMaxCtuDepth() const {
238  return mMaxCtuDepth;
239  }
240 
243  }
244 
246  return mMaxTemplateRecursion;
247  }
248 
249  void setMaxTemplateRecursion(int maxTemplateRecursion) {
250  mMaxTemplateRecursion = maxTemplateRecursion;
251  }
252 
253  /**
254  * @brief Get filename for the project file.
255  * @return file name.
256  */
257  const QString& getFilename() const {
258  return mFilename;
259  }
260 
261  /**
262  * @brief Set project root path.
263  * @param rootpath new project root path.
264  */
265  void setRootPath(const QString &rootpath) {
266  mRootPath = rootpath;
267  }
268 
269  void setBuildDir(const QString &buildDir) {
270  mBuildDir = buildDir;
271  }
272 
273  void setImportProject(const QString &importProject) {
274  mImportProject = importProject;
275  }
276 
277  void setAnalyzeAllVsConfigs(bool b) {
279  }
280 
281  /**
282  * @brief Set list of includes.
283  * @param includes List of defines.
284  */
285  void setIncludes(const QStringList &includes);
286 
287  /**
288  * @brief Set list of defines.
289  * @param defines List of defines.
290  */
291  void setDefines(const QStringList &defines);
292 
293  /**
294  * @brief Set list of undefines.
295  * @param undefines List of undefines.
296  */
297  void setUndefines(const QStringList &undefines);
298 
299  /**
300  * @brief Set list of paths to check.
301  * @param paths List of paths.
302  */
303  void setCheckPaths(const QStringList &paths);
304 
305  /**
306  * @brief Set list of paths to exclude from the check.
307  * @param paths List of paths.
308  */
309  void setExcludedPaths(const QStringList &paths);
310 
311  /**
312  * @brief Set list of libraries.
313  * @param libraries List of libraries.
314  */
315  void setLibraries(const QStringList &libraries);
316 
317  /**
318  * @brief Set platform.
319  * @param platform platform.
320  */
321  void setPlatform(const QString &platform);
322 
323  /**
324  * @brief Set list of suppressions.
325  * @param suppressions List of suppressions.
326  */
327  void setSuppressions(const QList<SuppressionList::Suppression> &suppressions);
328 
329  /** Add suppression */
330  void addSuppression(const SuppressionList::Suppression &suppression);
331 
332  /**
333  * @brief Set list of addons.
334  * @param addons List of addons.
335  */
336  void setAddons(const QStringList &addons);
337 
338  /** @brief Set list of Visual Studio configurations to be checked
339  * @param vsConfigs List of configurations
340  */
341  void setVSConfigurations(const QStringList &vsConfigs);
342 
343  /** CheckLevel: normal/exhaustive */
344  void setCheckLevel(CheckLevel checkLevel);
345  bool isCheckLevelExhaustive() const;
346 
347  /**
348  * @brief Set tags.
349  * @param tags tag list
350  */
351  void setTags(const QStringList &tags) {
352  mTags = tags;
353  }
354 
355  /** Set tags for a warning */
356  void setWarningTags(std::size_t hash, const QString& tags);
357 
358  /** Get tags for a warning */
359  QString getWarningTags(std::size_t hash) const;
360 
361  /** Bughunting (Cppcheck Premium) */
362  void setBughunting(bool bughunting) {
363  mBughunting = bughunting;
364  }
365  bool getBughunting() const {
366  return mBughunting;
367  }
368 
369  /** @brief Get list of coding standards (checked by Cppcheck Premium). */
370  const QStringList& getCodingStandards() const {
371  return mCodingStandards;
372  }
373 
374  /**
375  * @brief Set list of coding standards (checked by Cppcheck Premium).
376  * @param codingStandards List of coding standards.
377  */
378  void setCodingStandards(QStringList codingStandards) {
379  mCodingStandards = std::move(codingStandards);
380  }
381 
382  /** Cert C: int precision */
383  void setCertIntPrecision(int p) {
384  mCertIntPrecision = p;
385  }
386  int getCertIntPrecision() const {
387  return mCertIntPrecision;
388  }
389 
390 
391  /**
392  * @brief Write project file (to disk).
393  * @param filename Filename to use.
394  */
395  bool write(const QString &filename = QString());
396 
397  /**
398  * @brief Set filename for the project file.
399  * @param filename Filename to use.
400  */
401  void setFilename(const QString &filename) {
402  mFilename = filename;
403  }
404 
405  /** Do not only check how interface is used. Also check that interface is safe. */
407  public:
409 
410  void loadFromXml(QXmlStreamReader &xmlReader);
411  void saveToXml(QXmlStreamWriter &xmlWriter) const;
412  };
413 
415 
416  /** Check unknown function return values */
417  const QStringList& getCheckUnknownFunctionReturn() const {
419  }
420  /*
421  void setCheckUnknownFunctionReturn(const QStringList &s) {
422  mCheckUnknownFunctionReturn = s;
423  }
424  */
425 
426  /** Use Clang parser */
428 
429 protected:
430 
431  /**
432  * @brief Read optional root path from XML.
433  * @param reader XML stream reader.
434  */
435  void readRootPath(const QXmlStreamReader &reader);
436 
437  void readBuildDir(QXmlStreamReader &reader);
438 
439  /**
440  * @brief Read importproject from XML.
441  * @param reader XML stream reader.
442  */
443  void readImportProject(QXmlStreamReader &reader);
444 
445  static bool readBool(QXmlStreamReader &reader);
446 
447  static int readInt(QXmlStreamReader &reader, int defaultValue);
448 
449  static QString readString(QXmlStreamReader &reader);
450 
451  /**
452  * @brief Read list of include directories from XML.
453  * @param reader XML stream reader.
454  */
455  void readIncludeDirs(QXmlStreamReader &reader);
456 
457  /**
458  * @brief Read list of defines from XML.
459  * @param reader XML stream reader.
460  */
461  void readDefines(QXmlStreamReader &reader);
462 
463  /**
464  * @brief Read list paths to check.
465  * @param reader XML stream reader.
466  */
467  void readCheckPaths(QXmlStreamReader &reader);
468 
469  /**
470  * @brief Read lists of excluded paths.
471  * @param reader XML stream reader.
472  */
473  void readExcludes(QXmlStreamReader &reader);
474 
475  /**
476  * @brief Read lists of Visual Studio configurations
477  * @param reader XML stream reader.
478  */
479  void readVsConfigurations(QXmlStreamReader &reader);
480 
481  /**
482  * @brief Read platform text.
483  * @param reader XML stream reader.
484  */
485  void readPlatform(QXmlStreamReader &reader);
486 
487  /**
488  * @brief Read suppressions.
489  * @param reader XML stream reader.
490  */
491  void readSuppressions(QXmlStreamReader &reader);
492 
493  /**
494  * @brief Read tag warnings, what warnings are tagged with a specific tag
495  * @param reader XML stream reader.
496  */
497  void readTagWarnings(QXmlStreamReader &reader, const QString &tag);
498 
499  /**
500  * @brief Read string list
501  * @param stringlist destination string list
502  * @param reader XML stream reader
503  * @param elementname elementname for each string
504  */
505  static void readStringList(QStringList &stringlist, QXmlStreamReader &reader, const char elementname[]);
506 
507  /**
508  * @brief Write string list
509  * @param xmlWriter xml writer
510  * @param stringlist string list to write
511  * @param startelementname name of start element
512  * @param stringelementname name of each string element
513  */
514  static void writeStringList(QXmlStreamWriter &xmlWriter, const QStringList &stringlist, const char startelementname[], const char stringelementname[]);
515 
516 private:
517 
518  void clear();
519 
520  /**
521  * @brief Convert paths
522  */
523  static QStringList fromNativeSeparators(const QStringList &paths);
524 
525  /**
526  * @brief Filename (+path) of the project file.
527  */
528  QString mFilename;
529 
530  /**
531  * @brief Root path (optional) for the project.
532  * This is the project root path. If it is present then all relative paths in
533  * the project file are relative to this path. Otherwise paths are relative
534  * to project file's path.
535  */
536  QString mRootPath;
537 
538  /** Cppcheck build dir */
539  QString mBuildDir;
540 
541  /** Visual studio project/solution , compile database */
542  QString mImportProject;
543 
544  /**
545  * Should all visual studio configurations be analyzed?
546  * If this is false then only the Debug configuration
547  * for the set platform is analyzed.
548  */
550 
551  /** Check only a selected VS configuration */
552  QStringList mVsConfigurations;
553 
554  /** Check code in headers */
556 
557  /** Check code in unused templates */
559 
560  /**
561  * @brief List of include directories used to search include files.
562  */
563  QStringList mIncludeDirs;
564 
565  /**
566  * @brief List of defines.
567  */
568  QStringList mDefines;
569 
570  /**
571  * @brief List of undefines.
572  */
573  QStringList mUndefines;
574 
575  /**
576  * @brief List of paths to check.
577  */
578  QStringList mPaths;
579 
580  /**
581  * @brief Paths excluded from the check.
582  */
583  QStringList mExcludedPaths;
584 
585  /**
586  * @brief List of libraries.
587  */
588  QStringList mLibraries;
589 
590  /**
591  * @brief Platform
592  */
593  QString mPlatform;
594 
595  /**
596  * @brief List of suppressions.
597  */
598  QList<SuppressionList::Suppression> mSuppressions;
599 
600  /**
601  * @brief List of addons.
602  */
603  QStringList mAddons;
604 
605  bool mBughunting = false;
606 
607  /** @brief Should Cppcheck run normal or exhaustive analysis? */
609 
610  /**
611  * @brief List of coding standards, checked by Cppcheck Premium.
612  */
613  QStringList mCodingStandards;
614 
615  /** @brief Project name, used when generating compliance report */
616  QString mProjectName;
617 
618  /** @brief Cppcheck Premium: This value is passed to the Cert C checker if that is enabled */
620 
621  /** @brief Execute clang analyzer? */
623 
624  /** @brief Execute clang-tidy? */
626 
627  /**
628  * @brief Tags
629  */
630  QStringList mTags;
631 
632  /**
633  * @brief Warning tags
634  */
635  std::map<std::size_t, QString> mWarningTags;
636 
637  /** Max CTU depth */
639 
640  /** Max template instantiation recursion */
642 
644 
646 };
647 /// @}
648 #endif // PROJECT_FILE_H
Do not only check how interface is used.
Definition: projectfile.h:406
void loadFromXml(QXmlStreamReader &xmlReader)
void saveToXml(QXmlStreamWriter &xmlWriter) const
A class that reads and writes project files.
Definition: projectfile.h:46
void setMaxCtuDepth(int maxCtuDepth)
Definition: projectfile.h:241
std::map< std::size_t, QString > mWarningTags
Warning tags.
Definition: projectfile.h:635
SafeChecks safeChecks
Definition: projectfile.h:414
const QStringList & getCodingStandards() const
Get list of coding standards (checked by Cppcheck Premium).
Definition: projectfile.h:370
QStringList getAddonsAndTools() const
Get list of addons and tools.
bool mClangTidy
Execute clang-tidy?
Definition: projectfile.h:625
bool clangParser
Use Clang parser.
Definition: projectfile.h:427
void setAnalyzeAllVsConfigs(bool b)
Definition: projectfile.h:277
static ProjectFile * mActiveProject
Definition: projectfile.h:645
int getMaxCtuDepth() const
Definition: projectfile.h:237
QList< SuppressionList::Suppression > getCheckingSuppressions() const
Get "checking" suppressions.
void setActiveProject()
Definition: projectfile.h:64
const QStringList & getAddons() const
Get list addons.
Definition: projectfile.h:200
const QString & getPlatform() const
Get platform.
Definition: projectfile.h:170
void setCheckPaths(const QStringList &paths)
Set list of paths to check.
void setCheckLevel(CheckLevel checkLevel)
CheckLevel: normal/exhaustive.
QStringList mTags
Tags.
Definition: projectfile.h:630
void readDefines(QXmlStreamReader &reader)
Read list of defines from XML.
bool isCheckLevelExhaustive() const
ProjectFile(QObject *parent=nullptr)
Definition: projectfile.cpp:44
const QString & getFilename() const
Get filename for the project file.
Definition: projectfile.h:257
const QString & getRootPath() const
Get project root path.
Definition: projectfile.h:78
void setCodingStandards(QStringList codingStandards)
Set list of coding standards (checked by Cppcheck Premium).
Definition: projectfile.h:378
bool getBughunting() const
Definition: projectfile.h:365
bool getClangAnalyzer() const
Definition: projectfile.h:217
QString mFilename
Filename (+path) of the project file.
Definition: projectfile.h:528
QList< SuppressionList::Suppression > mSuppressions
List of suppressions.
Definition: projectfile.h:598
void setBuildDir(const QString &buildDir)
Definition: projectfile.h:269
void setCheckHeaders(bool b)
Definition: projectfile.h:98
void readBuildDir(QXmlStreamReader &reader)
QStringList mExcludedPaths
Paths excluded from the check.
Definition: projectfile.h:583
QStringList mVsConfigurations
Check only a selected VS configuration.
Definition: projectfile.h:552
void clear()
Definition: projectfile.cpp:58
void readSuppressions(QXmlStreamReader &reader)
Read suppressions.
const QList< SuppressionList::Suppression > & getSuppressions() const
Get "raw" suppressions.
Definition: projectfile.h:186
~ProjectFile() override
Definition: projectfile.h:52
void readExcludes(QXmlStreamReader &reader)
Read lists of excluded paths.
static ProjectFile * getActiveProject()
Definition: projectfile.h:61
static int readInt(QXmlStreamReader &reader, int defaultValue)
bool mCheckUnusedTemplates
Check code in unused templates.
Definition: projectfile.h:558
QStringList mCheckUnknownFunctionReturn
Definition: projectfile.h:643
const QStringList & getCheckUnknownFunctionReturn() const
Check unknown function return values.
Definition: projectfile.h:417
void setTags(const QStringList &tags)
Set tags.
Definition: projectfile.h:351
void setExcludedPaths(const QStringList &paths)
Set list of paths to exclude from the check.
const QStringList & getDefines() const
Get list of defines.
Definition: projectfile.h:122
int mCertIntPrecision
Cppcheck Premium: This value is passed to the Cert C checker if that is enabled.
Definition: projectfile.h:619
void setClangTidy(bool c)
Definition: projectfile.h:229
void setVSConfigurations(const QStringList &vsConfigs)
Set list of Visual Studio configurations to be checked.
const QString & getProjectName() const
Definition: projectfile.h:174
QStringList mDefines
List of defines.
Definition: projectfile.h:568
QString mImportProject
Visual studio project/solution , compile database.
Definition: projectfile.h:542
QString mRootPath
Root path (optional) for the project.
Definition: projectfile.h:536
QStringList mCodingStandards
List of coding standards, checked by Cppcheck Premium.
Definition: projectfile.h:613
QStringList getCheckPaths() const
Get list of paths to check.
Definition: projectfile.h:138
void setDefines(const QStringList &defines)
Set list of defines.
void readTagWarnings(QXmlStreamReader &reader, const QString &tag)
Read tag warnings, what warnings are tagged with a specific tag.
static bool readBool(QXmlStreamReader &reader)
QString mPlatform
Platform.
Definition: projectfile.h:593
QString getWarningTags(std::size_t hash) const
Get tags for a warning.
void setCertIntPrecision(int p)
Cert C: int precision.
Definition: projectfile.h:383
static QStringList fromNativeSeparators(const QStringList &paths)
Convert paths.
void readCheckPaths(QXmlStreamReader &reader)
Read list paths to check.
static void writeStringList(QXmlStreamWriter &xmlWriter, const QStringList &stringlist, const char startelementname[], const char stringelementname[])
Write string list.
void setUndefines(const QStringList &undefines)
Set list of undefines.
bool mAnalyzeAllVsConfigs
Should all visual studio configurations be analyzed? If this is false then only the Debug configurati...
Definition: projectfile.h:549
void setIncludes(const QStringList &includes)
Set list of includes.
static void readStringList(QStringList &stringlist, QXmlStreamReader &reader, const char elementname[])
Read string list.
bool getClangTidy() const
Definition: projectfile.h:225
bool getAnalyzeAllVsConfigs() const
Definition: projectfile.h:90
void readVsConfigurations(QXmlStreamReader &reader)
Read lists of Visual Studio configurations.
int getCertIntPrecision() const
Definition: projectfile.h:386
int getMaxTemplateRecursion() const
Definition: projectfile.h:245
QStringList mAddons
List of addons.
Definition: projectfile.h:603
const QStringList & getUndefines() const
Get list of undefines.
Definition: projectfile.h:130
QStringList mUndefines
List of undefines.
Definition: projectfile.h:573
void setImportProject(const QString &importProject)
Definition: projectfile.h:273
void setWarningTags(std::size_t hash, const QString &tags)
Set tags for a warning.
void setLibraries(const QStringList &libraries)
Set list of libraries.
const QStringList & getVsConfigurations() const
Get list of paths to exclude from the check.
Definition: projectfile.h:154
static QString getAddonFilePath(QString filesDir, const QString &addon)
Get path to addon python script.
bool read(const QString &filename=QString())
Read the project file.
Definition: projectfile.cpp:94
void readIncludeDirs(QXmlStreamReader &reader)
Read list of include directories from XML.
QStringList mPaths
List of paths to check.
Definition: projectfile.h:578
const QStringList & getTags() const
Definition: projectfile.h:233
bool mBughunting
Definition: projectfile.h:605
void setProjectName(QString projectName)
Definition: projectfile.h:178
void setMaxTemplateRecursion(int maxTemplateRecursion)
Definition: projectfile.h:249
int mMaxTemplateRecursion
Max template instantiation recursion.
Definition: projectfile.h:641
void setFilename(const QString &filename)
Set filename for the project file.
Definition: projectfile.h:401
void setAddons(const QStringList &addons)
Set list of addons.
bool getCheckUnusedTemplates() const
Definition: projectfile.h:102
void setPlatform(const QString &platform)
Set platform.
QStringList getExcludedPaths() const
Get list of paths to exclude from the check.
Definition: projectfile.h:146
void addSuppression(const SuppressionList::Suppression &suppression)
Add suppression.
void readRootPath(const QXmlStreamReader &reader)
Read optional root path from XML.
QString mBuildDir
Cppcheck build dir.
Definition: projectfile.h:539
QStringList mIncludeDirs
List of include directories used to search include files.
Definition: projectfile.h:563
void setBughunting(bool bughunting)
Bughunting (Cppcheck Premium)
Definition: projectfile.h:362
void readPlatform(QXmlStreamReader &reader)
Read platform text.
int mMaxCtuDepth
Max CTU depth.
Definition: projectfile.h:638
void setRootPath(const QString &rootpath)
Set project root path.
Definition: projectfile.h:265
QStringList getIncludeDirs() const
Get list of include directories.
Definition: projectfile.h:114
QStringList mLibraries
List of libraries.
Definition: projectfile.h:588
bool getCheckHeaders() const
Definition: projectfile.h:94
void setCheckUnusedTemplates(bool b)
Definition: projectfile.h:106
const QStringList & getLibraries() const
Get list libraries.
Definition: projectfile.h:162
const QString & getBuildDir() const
Definition: projectfile.h:82
bool mClangAnalyzer
Execute clang analyzer?
Definition: projectfile.h:622
void setClangAnalyzer(bool c)
Definition: projectfile.h:221
bool write(const QString &filename=QString())
Write project file (to disk).
static QString readString(QXmlStreamReader &reader)
void readImportProject(QXmlStreamReader &reader)
Read importproject from XML.
void setSuppressions(const QList< SuppressionList::Suppression > &suppressions)
Set list of suppressions.
bool mCheckHeaders
Check code in headers.
Definition: projectfile.h:555
QString mProjectName
Project name, used when generating compliance report.
Definition: projectfile.h:616
const QString & getImportProject() const
Definition: projectfile.h:86
CheckLevel mCheckLevel
Should Cppcheck run normal or exhaustive analysis?
Definition: projectfile.h:608
This is just a container for general settings so that we don't need to pass individual values to func...
Definition: settings.h:95
int maxCtuDepth
Definition: ctu.cpp:58
Do not only check how interface is used.
Definition: settings.h:316