4#include <wx/filename.h>
49 case Styles::STANDARD:
51 case Styles::CONSOLE_STD:
57 case Styles::DOCCOMMENT:
59 case Styles::DOCKEYWORD:
63 case Styles::FUNCTION:
65 case Styles::CUSTOM_FUNCTION:
69 case Styles::CONSTANT:
71 case Styles::SPECIALVAL:
75 case Styles::STRINGPARSER:
77 case Styles::OPERATOR:
79 case Styles::INCLUDES:
81 case Styles::PROCEDURE:
83 case Styles::PROCEDURE_COMMAND:
91 case Styles::DEFAULT_VARS:
93 case Styles::ACTIVE_LINE:
95 case Styles::STYLE_END:
152 if (!_config->HasGroup(
"Styles"))
155 static wxString KeyValues[] = {
184 for (
size_t i = 0; i < Styles::STYLE_END; i++)
186 if (_config->Read(
"Styles/"+KeyValues[i], &val))
207 if (!_config->HasGroup(
"AnalyzerOptions"))
210 static wxString KeyValues[] = {
218 "ALWAYS_SHOW_METRICS",
220 "CONSTANT_EXPRESSION",
221 "RESULT_SUPPRESSION",
225 "ARGUMENT_UNDERSCORE",
229 "THISFILE_NAMESPACE",
231 "SWITCH_FALLTHROUGH",
233 "ANALYZER_OPTIONS_END"
238 for (
size_t i = 0; i < AnalyzerOptions::ANALYZER_OPTIONS_END; i++)
240 if (_config->Read(
"AnalyzerOptions/"+KeyValues[i], &val))
260 if (setting.length())
277 wxArrayString sReturn;
278 sReturn.Add(
"STANDARD");
279 sReturn.Add(
"CONSOLE_STD");
280 sReturn.Add(
"COMMAND");
281 sReturn.Add(
"COMMENT");
282 sReturn.Add(
"DOCUMENTATIONCOMMENT");
283 sReturn.Add(
"DOCUMENTATIONKEYWORD");
284 sReturn.Add(
"OPTION");
285 sReturn.Add(
"FUNCTION");
286 sReturn.Add(
"CUSTOM_FUNCTION");
287 sReturn.Add(
"CLUSTER");
288 sReturn.Add(
"CONSTANT");
289 sReturn.Add(
"SPECIALVAL");
290 sReturn.Add(
"STRING");
291 sReturn.Add(
"STRINGPARSER");
292 sReturn.Add(
"INCLUDES");
293 sReturn.Add(
"OPERATOR");
294 sReturn.Add(
"PROCEDURE");
295 sReturn.Add(
"NUMBER");
296 sReturn.Add(
"PROCEDURE_COMMAND");
297 sReturn.Add(
"METHODS");
298 sReturn.Add(
"INSTALL");
299 sReturn.Add(
"DEFAULT_VARS");
300 sReturn.Add(
"ACTIVE_LINE");
319 return identifiers.Index(identifier);
336 case AnalyzerOptions::USE_NOTES:
338 case AnalyzerOptions::USE_WARNINGS:
340 case AnalyzerOptions::USE_ERRORS:
342 case AnalyzerOptions::COMMENT_DENSITY:
344 case AnalyzerOptions::LINES_OF_CODE:
346 case AnalyzerOptions::COMPLEXITY:
348 case AnalyzerOptions::MAGIC_NUMBERS:
350 case AnalyzerOptions::ALWAYS_SHOW_METRICS:
352 case AnalyzerOptions::INLINE_IF:
354 case AnalyzerOptions::CONSTANT_EXPRESSION:
356 case AnalyzerOptions::RESULT_SUPPRESSION:
358 case AnalyzerOptions::RESULT_ASSIGNMENT:
360 case AnalyzerOptions::TYPE_ORIENTATION:
362 case AnalyzerOptions::MISLEADING_TYPE:
364 case AnalyzerOptions::ARGUMENT_UNDERSCORE:
366 case AnalyzerOptions::VARIABLE_LENGTH:
368 case AnalyzerOptions::UNUSED_VARIABLES:
370 case AnalyzerOptions::PROCEDURE_LENGTH:
372 case AnalyzerOptions::THISFILE_NAMESPACE:
374 case AnalyzerOptions::PROGRESS_RUNTIME:
376 case AnalyzerOptions::SWITCH_FALLTHROUGH:
378 case AnalyzerOptions::GLOBAL_VARIABLES:
380 case AnalyzerOptions::ANALYZER_OPTIONS_END:
400 case Styles::STANDARD:
402 case Styles::CONSOLE_STD:
404 case Styles::COMMAND:
406 case Styles::COMMENT:
408 case Styles::DOCCOMMENT:
410 case Styles::DOCKEYWORD:
414 case Styles::FUNCTION:
416 case Styles::CUSTOM_FUNCTION:
418 case Styles::CLUSTER:
420 case Styles::CONSTANT:
422 case Styles::SPECIALVAL:
426 case Styles::STRINGPARSER:
428 case Styles::INCLUDES:
430 case Styles::OPERATOR:
432 case Styles::PROCEDURE:
436 case Styles::PROCEDURE_COMMAND:
438 case Styles::METHODS:
440 case Styles::INSTALL:
442 case Styles::DEFAULT_VARS:
444 case Styles::ACTIVE_LINE:
446 case Styles::STYLE_END:
std::string analyzerOptsToString(AnalyzerOptions opt) const
Convert the static code analyzer enumeration values into the new settings strings.
void SetSyntaxStyle(size_t i, const SyntaxStyles &styles)
Update a selected syntax style by converting the passed SyntaxStyles object into a style string and s...
size_t GetIdByIdentifier(const wxString &identifier) const
This member function returns the ID of a syntax style by passing the style identifier as a string.
Styles
An enumeration of all available syntax styles.
void readColoursFromConfig(wxFileConfig *_config)
Legacy syntax style import function from file configuration.
int GetAnalyzerOption(AnalyzerOptions opt) const
Return the value of the selected static code analyzer option.
AnalyzerOptions
An enumeration of all available static analyzer options.
void readAnalyzerOptionsFromConfig(wxFileConfig *_config)
Legacy analyzer import function from file configuration.
SyntaxStyles GetSyntaxStyle(size_t i) const
Return the selected syntax style by constructing it from the style string.
SyntaxStyles GetDefaultSyntaxStyle(size_t i) const
Return the default syntax style as defined by the programmers.
wxArrayString GetStyleIdentifier() const
This member function returns an array of the style enumeration identifiers converted to a string.
void SetAnalyzerOption(AnalyzerOptions opt, int nVal)
Change a static code analyzer setting.
std::string syntaxStylesToString(Styles style) const
Convert the syntax style enumeration values into the new settings strings.
This class manages the setting values of the internal (kernel) settings of this application.
std::map< std::string, SettingsValue > m_settings
int StrToInt(const std::string &)
Converts a string into an integer.
#define DEFAULT_ST_DOCCOMMENT
#define DEFAULT_ST_ACTIVELINE
#define DEFAULT_ST_STANDARD
#define SETTING_S_ST_FUNCTION
#define SETTING_B_AN_CONSTANTS
#define SETTING_S_ST_CLUSTER
#define SETTING_B_AN_USEERRORS
#define SETTING_S_ST_PROCCOMMAND
#define DEFAULT_ST_OPERATOR
#define SETTING_B_AN_GLOBALVARS
#define SETTING_B_AN_TYPING
#define DEFAULT_ST_PROCEDURE
#define SETTING_B_AN_PROCLENGTH
#define DEFAULT_ST_OPTION
#define DEFAULT_ST_FUNCTION
#define SETTING_B_AN_INLINEIF
#define DEFAULT_ST_CLUSTER
#define SETTING_S_ST_INCLUDES
#define SETTING_S_ST_ACTIVELINE
#define SETTING_S_ST_OPTION
#define DEFAULT_ST_NUMBER
#define DEFAULT_ST_COMMAND
#define SETTING_S_ST_CUSTOMFUNC
#define SETTING_S_ST_INSTALL
#define SETTING_B_AN_COMMENTDENS
#define SETTING_B_AN_COMPLEXITY
#define SETTING_S_ST_METHODS
#define SETTING_B_AN_USENOTES
#define SETTING_S_ST_STRINGPARSER
#define DEFAULT_ST_STRINGPARSER
#define SETTING_B_AN_UNDERSCOREARGS
#define SETTING_B_AN_THISFILE
#define SETTING_B_AN_PROGRESS
#define DEFAULT_ST_INCLUDES
#define SETTING_B_AN_UNUSEDVARS
#define SETTING_S_ST_PROCEDURE
#define SETTING_B_AN_FALLTHROUGH
#define DEFAULT_ST_STRING
#define DEFAULT_ST_DEFVARS
#define SETTING_B_AN_ALWAYSMETRICS
#define DEFAULT_ST_SPECIALVAL
#define SETTING_S_ST_DOCKEYWORD
#define DEFAULT_ST_PROCCOMMAND
#define SETTING_S_ST_SPECIALVAL
#define SETTING_B_AN_VARLENGTH
#define DEFAULT_ST_METHODS
#define SETTING_B_AN_RESULTASS
#define SETTING_S_ST_COMMENT
#define SETTING_S_ST_STANDARD
#define DEFAULT_ST_CONSOLESTD
#define SETTING_S_ST_STRING
#define DEFAULT_ST_CUSTOMFUNC
#define DEFAULT_ST_CONSTANT
#define DEFAULT_ST_COMMENT
#define DEFAULT_ST_DOCKEYWORD
#define SETTING_S_ST_DEFVARS
#define DEFAULT_ST_INSTALL
#define SETTING_S_ST_OPERATOR
#define SETTING_S_ST_NUMBER
#define SETTING_B_AN_RESULTSUP
#define SETTING_S_ST_COMMAND
#define SETTING_S_ST_CONSTANT
#define SETTING_S_ST_CONSOLESTD
#define SETTING_B_AN_MISLEADINGTYPE
#define SETTING_B_AN_USEWARNINGS
#define SETTING_B_AN_MAGICNUMBERS
#define SETTING_S_ST_DOCCOMMENT
This structure contains the necessary data to completely define a style for a distinctive syntax elem...
std::string to_string() const
Transforms the internal data into a string style representation according the following scheme: r:g:b...