File: cppcheck_settings.cpp

package info (click to toggle)
codelite 2.6.0.4189~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 30,868 kB
  • ctags: 32,563
  • sloc: cpp: 237,275; ansic: 20,775; lex: 2,114; yacc: 2,007; xml: 1,274; sh: 1,064; makefile: 566; python: 163
file content (69 lines) | stat: -rw-r--r-- 1,878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <wx/xrc/xmlres.h>
#include <memory>
#include <wx/stdpaths.h>
#include "cppcheck_settings.h"
#include "plugin.h"
#include <stdio.h>

// Some macros needed
#ifdef __WXMSW__
#define PIPE_NAME "\\\\.\\pipe\\cppchecker_%s"
#else
#define PIPE_NAME "/tmp/cppchecker.%s.sock"
#endif

//------------------------------------------------------

const wxEventType wxEVT_CPPCHECKJOB_STATUS_MESSAGE  = XRCID("cppcheck_status_message");
const wxEventType wxEVT_CPPCHECKJOB_CHECK_COMPLETED = XRCID("cppcheck_check_completed");
const wxEventType wxEVT_CPPCHECKJOB_REPORT          = XRCID("cppcheck_report");



//------------------------------------------------------

CppCheckSettings::CppCheckSettings()
: m_bAll(true)
, m_bForce(false)
, m_bStyle(true)
, m_bUnusedFunctions(false)
{
}

void CppCheckSettings::Serialize(Archive &arch)
{
	arch.Write(wxT("option.all"),             m_bAll);
	arch.Write(wxT("option.force"),           m_bForce);
	arch.Write(wxT("option.style"),           m_bStyle);
	arch.Write(wxT("option.unusedFunctions"), m_bUnusedFunctions);
	arch.Write(wxT("m_excludeFiles"),         m_excludeFiles);
}

void CppCheckSettings::DeSerialize(Archive &arch)
{
	arch.Read(wxT("option.all"),             m_bAll);
	arch.Read(wxT("option.force"),           m_bForce);
	arch.Read(wxT("option.style"),           m_bStyle);
	arch.Read(wxT("option.unusedFunctions"), m_bUnusedFunctions);
	arch.Read(wxT("m_excludeFiles"),         m_excludeFiles);
}

wxString CppCheckSettings::GetOptions() const
{
	wxString options;
	if (All()) {
		options << wxT(" --enable=all ");
	}
	if (Force()) {
		options << wxT("--force ");
	}
	if (Style()) {
		options << wxT(" --enable=style ");
	}
	if (UnusedFunctions()) {
		options << wxT(" --enable=unusedFunctions ");
	}

	options << wxT(" --template gcc ");
	return options;
}