|
2 | 2 | #include "PluginInterface.h"
|
3 | 3 |
|
4 | 4 | // Define the number of plugin commands here
|
5 |
| -enum class CallBackID :int { SHOW_DOC_PANEL = 0, FORMAT, COMPRESS, SEP_1, SETTING, ABOUT }; |
| 5 | +enum class CallBackID : int |
| 6 | +{ |
| 7 | + SHOW_DOC_PANEL = 0, |
| 8 | + FORMAT, |
| 9 | + COMPRESS, |
| 10 | + SEP_1, |
| 11 | + SETTING, |
| 12 | + ABOUT |
| 13 | +}; |
6 | 14 | constexpr const int nTotalCommandCount = static_cast<int>(CallBackID::ABOUT) + 1;
|
7 | 15 |
|
8 | 16 | // Define plugin name here
|
9 |
| -const TCHAR PLUGIN_NAME[] = TEXT("JSON Viewer"); |
| 17 | +const TCHAR PLUGIN_NAME[] = TEXT("JSON Viewer"); |
10 | 18 | const TCHAR PLUGIN_CONFIG[] = TEXT("JSONViewer.ini");
|
11 | 19 |
|
12 | 20 | // Text which can be considered for localization
|
13 |
| -const TCHAR TITLE_JSON_PANEL[] = TEXT("JSON Viewer Panel"); |
| 21 | +const TCHAR TITLE_JSON_PANEL[] = TEXT("JSON Viewer Panel"); |
14 | 22 | const TCHAR MENU_SHOW_JSON_PANEL[] = TEXT("Show &JSON Viewer");
|
15 |
| -const TCHAR MENU_FORMAT_JSON[] = TEXT("&Format JSON"); |
16 |
| -const TCHAR MENU_COMPRESS_JSON[] = TEXT("&Compress JSON"); |
17 |
| -const TCHAR MENU_SETTING[] = TEXT("&Setting"); |
18 |
| -const TCHAR MENU_ABOUT[] = TEXT("&About"); |
19 |
| -const TCHAR MENU_SEPERATOR[] = TEXT("-SEPARATOR-"); |
| 23 | +const TCHAR MENU_FORMAT_JSON[] = TEXT("&Format JSON"); |
| 24 | +const TCHAR MENU_COMPRESS_JSON[] = TEXT("&Compress JSON"); |
| 25 | +const TCHAR MENU_SETTING[] = TEXT("&Setting"); |
| 26 | +const TCHAR MENU_ABOUT[] = TEXT("&About"); |
| 27 | +const TCHAR MENU_SEPERATOR[] = TEXT("-SEPARATOR-"); |
20 | 28 |
|
21 |
| -const TCHAR TOOLTIP_REFRESH[] = TEXT("Refresh JSON tree"); |
| 29 | +const TCHAR TOOLTIP_REFRESH[] = TEXT("Refresh JSON tree"); |
22 | 30 | const TCHAR TOOLTIP_VALIDATE[] = TEXT("Validate JSON to detect any error");
|
23 |
| -const TCHAR TOOLTIP_FORMAT[] = TEXT("Format JSON to beautify it"); |
24 |
| -const TCHAR TOOLTIP_SEARCH[] = TEXT("Search in JSON"); |
| 31 | +const TCHAR TOOLTIP_FORMAT[] = TEXT("Format JSON to beautify it"); |
| 32 | +const TCHAR TOOLTIP_SEARCH[] = TEXT("Search in JSON"); |
25 | 33 |
|
26 |
| -const TCHAR URL_SOURCE_CODE[] = TEXT("https://github.com/kapilratnani/JSON-Viewer"); |
| 34 | +const TCHAR URL_SOURCE_CODE[] = TEXT("https://github.com/kapilratnani/JSON-Viewer"); |
27 | 35 | const TCHAR URL_REPORT_ISSUE[] = TEXT("https://github.com/kapilratnani/JSON-Viewer/issues/new");
|
28 | 36 |
|
29 |
| - |
30 | 37 | const TCHAR JSON_ROOT[] = TEXT("JSON");
|
31 | 38 |
|
32 |
| -const TCHAR JSON_ERROR_TITLE[] = TEXT("JSON Viewer: Error"); |
| 39 | +const TCHAR JSON_ERROR_TITLE[] = TEXT("JSON Viewer: Error"); |
33 | 40 | const TCHAR JSON_WARNING_TITLE[] = TEXT("JSON Viewer: Warning");
|
34 |
| -const TCHAR JSON_INFO_TITLE[] = TEXT("JSON Viewer: Information"); |
| 41 | +const TCHAR JSON_INFO_TITLE[] = TEXT("JSON Viewer: Information"); |
35 | 42 |
|
36 |
| -const TCHAR JSON_ERR_PARSE[] = TEXT("Cannot parse JSON. Please select a JSON String."); |
37 |
| -const TCHAR JSON_ERR_VALIDATE[] = TEXT("There was an error while parsing JSON. Refer the current selection for possible problematic area."); |
| 43 | +const TCHAR JSON_ERR_PARSE[] = TEXT("Cannot parse JSON. Please select a JSON String."); |
| 44 | +const TCHAR JSON_ERR_VALIDATE[] = TEXT("There was an error while parsing JSON. Refer the current selection for possible problematic area."); |
38 | 45 | const TCHAR JSON_ERR_VALIDATE_SUCCESS[] = TEXT("JSON looks good. No error found while validating it.");
|
39 |
| -const TCHAR JSON_ERR_SAVE_SETTING[] = TEXT("Failed to save the setting. Please try again."); |
40 |
| - |
41 |
| -const TCHAR STR_VERSION[] = TEXT("Version: "); |
42 |
| -const TCHAR STR_COPY[] = TEXT("Copy"); |
43 |
| -const TCHAR STR_COPYNAME[] = TEXT("Copy name"); |
44 |
| -const TCHAR STR_COPYVALUE[] = TEXT("Copy value"); |
45 |
| -const TCHAR STR_COPYPATH[] = TEXT("Copy path"); |
46 |
| -const TCHAR STR_EXPANDALL[] = TEXT("Expand all"); |
| 46 | +const TCHAR JSON_ERR_SAVE_SETTING[] = TEXT("Failed to save the setting. Please try again."); |
| 47 | + |
| 48 | +const TCHAR STR_VERSION[] = TEXT("Version: "); |
| 49 | +const TCHAR STR_COPY[] = TEXT("Copy"); |
| 50 | +const TCHAR STR_COPYNAME[] = TEXT("Copy name"); |
| 51 | +const TCHAR STR_COPYVALUE[] = TEXT("Copy value"); |
| 52 | +const TCHAR STR_COPYPATH[] = TEXT("Copy path"); |
| 53 | +const TCHAR STR_EXPANDALL[] = TEXT("Expand all"); |
47 | 54 | const TCHAR STR_COLLAPSEALL[] = TEXT("Collapse all");
|
48 | 55 |
|
49 |
| -const TCHAR STR_INI_FORMATTING_SEC[] = TEXT("Formatting"); |
50 |
| -const TCHAR STR_INI_FORMATTING_EOL[] = TEXT("EOL"); |
51 |
| -const TCHAR STR_INI_FORMATTING_LINE[] = TEXT("LINE_FORMATTING"); |
52 |
| -const TCHAR STR_INI_FORMATTING_INDENT[] = TEXT("INDENTATION"); |
| 56 | +const TCHAR STR_INI_FORMATTING_SEC[] = TEXT("Formatting"); |
| 57 | +const TCHAR STR_INI_FORMATTING_EOL[] = TEXT("EOL"); |
| 58 | +const TCHAR STR_INI_FORMATTING_LINE[] = TEXT("LINE_FORMATTING"); |
| 59 | +const TCHAR STR_INI_FORMATTING_INDENT[] = TEXT("INDENTATION"); |
53 | 60 | const TCHAR STR_INI_FORMATTING_INDENTCOUNT[] = TEXT("INDENTATION_COUNT");
|
54 | 61 |
|
55 |
| -const TCHAR STR_INI_OTHER_SEC[] = TEXT("Others"); |
56 |
| -const TCHAR STR_INI_OTHER_FOLLOW_TAB[] = TEXT("FOLLOW_TAB"); |
57 |
| -const TCHAR STR_INI_OTHER_AUTO_FORMAT[] = TEXT("AUTO_FORMAT"); |
| 62 | +const TCHAR STR_INI_OTHER_SEC[] = TEXT("Others"); |
| 63 | +const TCHAR STR_INI_OTHER_FOLLOW_TAB[] = TEXT("FOLLOW_TAB"); |
| 64 | +const TCHAR STR_INI_OTHER_AUTO_FORMAT[] = TEXT("AUTO_FORMAT"); |
58 | 65 | const TCHAR STR_INI_OTHER_IGNORE_COMMENT[] = TEXT("IGNORE_COMMENT");
|
59 |
| -const TCHAR STR_INI_OTHER_IGNORE_COMMA[] = TEXT("IGNORE_TRAILLING_COMMA"); |
| 66 | +const TCHAR STR_INI_OTHER_IGNORE_COMMA[] = TEXT("IGNORE_TRAILLING_COMMA"); |
| 67 | + |
| 68 | +enum class LineEnding |
| 69 | +{ |
| 70 | + AUTO, |
| 71 | + WINDOWS, |
| 72 | + UNIX, |
| 73 | + MAC |
| 74 | +}; |
| 75 | + |
| 76 | +enum class LineFormat |
| 77 | +{ |
| 78 | + DEFAULT, |
| 79 | + SINGLELINE |
| 80 | +}; |
| 81 | + |
| 82 | +enum class IndentStyle |
| 83 | +{ |
| 84 | + AUTO, |
| 85 | + TAB, |
| 86 | + SPACE |
| 87 | +}; |
60 | 88 |
|
61 |
| -enum class LineEnding { AUTO, WINDOWS, UNIX, MAC }; |
62 |
| -enum class LineFormat { DEFAULT, SINGLELINE }; |
63 |
| -enum class IndentStyle { AUTO, TAB, SPACE }; |
64 | 89 | struct Indent
|
65 | 90 | {
|
66 |
| - unsigned len = 4; |
67 |
| - IndentStyle style = IndentStyle::AUTO; |
| 91 | + unsigned len = 4; |
| 92 | + IndentStyle style = IndentStyle::AUTO; |
68 | 93 | };
|
69 | 94 |
|
70 | 95 | struct ParseOptions
|
71 | 96 | {
|
72 |
| - bool bIgnoreComment = true; |
73 |
| - bool bIgnoreTraillingComma = true; |
| 97 | + bool bIgnoreComment = true; |
| 98 | + bool bIgnoreTraillingComma = true; |
74 | 99 | };
|
75 | 100 |
|
76 | 101 | struct Setting
|
77 | 102 | {
|
78 |
| - LineEnding lineEnding = LineEnding::AUTO; |
79 |
| - LineFormat lineFormat = LineFormat::DEFAULT; |
80 |
| - Indent indent{}; |
81 |
| - bool bFollowCurrentTab = false; |
82 |
| - bool bAutoFormat = false; |
83 |
| - ParseOptions parseOptions{}; |
| 103 | + LineEnding lineEnding = LineEnding::AUTO; |
| 104 | + LineFormat lineFormat = LineFormat::DEFAULT; |
| 105 | + Indent indent {}; |
| 106 | + bool bFollowCurrentTab = false; |
| 107 | + bool bAutoFormat = false; |
| 108 | + ParseOptions parseOptions {}; |
84 | 109 | };
|
85 |
| - |
|
0 commit comments