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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>iniFileFormat</title>
</head>
<body>
<p>
Fileformat of the UniversalIndentGUI indent description ini files<br />
=================================================================<br />
<br />
1. General<br />
----------<br />
The ini file has equal base format as common used ini files. It contains groups, which are written in brackets []. These groups can contain keys, to which a value can be assigned by the equal sign =.<br />
<br />
2. Ini file header<br />
------------------<br />
At the beginning of the ini file the header is located. It is named [header]. In the following a ini file header is shown:<br />
</p>
<pre>
[header]
categories=Predefined Style|Tab and Bracket|Indentation|Formatting
cfgFileParameterEnding=cr
configFilename=.astylerc
fileTypes=*.cpp|*.c|*.h|*.hpp|*.cs|*.java
indenterFileName=astyle
indenterName=Artistic Style
inputFileName=indentinput
inputFileParameter=
manual="http://website.of.onlinemanual"
outputFileName=indentinput
outputFileParameter=none
parameterOrder=ipo
stringparaminquotes=false
useCfgFileParameter="--options="
version=1.21
</pre>
<p>
"categories" defines the categories, where each parameter can be assigned to. It is a list of strings, with each category name divied by a "|" from the other.<br />
<br />
"cfgFileParameterEnding" defines how each parameter setting in the indenters config file is seperated from the other. Possible values are "cr" for CarriageReturn or any other string (also space signs, which are normally used if parameters are only set via commandline).<br />
<br />
"configFilename" is the filename of the indenters default config file. It is used when the indenter is being called and might be explicit handed over as argument by setting the parameter "useCfgFileParameter". If "configFilename" is left empty, all parameters are set with the commandline call of the indenter. (As needed for csstidy and phpCB for example.)<br />
<br />
"fileTypes" is a list of fileendings used for the selection in the "open source file" file dialog.<br />
<br />
"indenterFileName" is the name of the indenters executable without any extension. Under linux it is tested, whether only a file with the extension ".exe" exists. If so, wine will be used to call the indenter.<br />
<br />
"indenterName" is the name of the indenter as it will be shown in UniversalIndentGUIs indenters selection. Theoretic it can be any string.<br />
<br />
"inputFileName" defines the file used as input file for the called indenter. It is a copy of the previous opened source code file.<br />
<br />
"inputFileParameter" sets the eventually needed parameter in front of "inputFileName" to tell the indenter and the command line call that the following string is the input file. If set to "none" no special output file will be set.
If set to "<" or "stdin" the to be formatted source code will be sent to the indenter using the standard input stdin.<br />
<br />
"manual" is a string that points to a website that hosts the indenters online manual.<br />
<br />
"outputFileName" the file name where the indenter writes its formatted source code to. Also the file UniversalIndentGUI reads after the indenter call to show it in the preview. Some times an indenter overwrites the content of the inputfile by default and creates a backup (as AStyle does). In this case "outputFileName" is equal to "inputFileName" but the parameter "outputFileParameter" has to be set to "none". No output file name will be selected for the indenter but UniversalIndentGUI knows where the output was written to.<br />
<br />
"outputFileParameter" same as for "inputFileParameter" with respect to the special case mentioned for "inputFileParameter" if the input file will be overwritten. If the indenter only writes to standard output (stdout) this value has to be set to "stdout" (see uigui_phpCB.ini). In that case "outputFileName" can be left empty. It will be ignored anyway.<br />
<br />
"parameterOrder" Some indenters need a strict order of the command line parameters for input file, output file and eventually indent settings. "parameterOrder" can be set to "iop", "ipo" and "pio" to define the order of input, ouput and paramters at the commandline call.<br />
<br />
"stringparaminquotes" tells UniversalIndentGUI that all string values should be written to the indenter config file in quotes.<br />
<br />
"useCfgFileParameter" is the parameter for the indenter used to tell the indenter where to find the config file, set in "configFilename", that it should use. If this parameter is left empty you should read the indenters manual where it searches by default for the config file.<br />
<br />
"version" is not evaluated by UiGUI, but by this it is easier to see for which version of the indenter the configuration file has been written for.<br />
<br />
3. The indenters parameters<br />
---------------------------<br />
After the header definition the paramters used by the indenter are defined. Each paramter name is written in brackets [] again, but the name is only descriptive and not functional. Each parameter consists of keys with values (same as in header). There are four types of parameters: boolean, numeric, string and multiple. All have the following keys in common:<br />
"Category" defines to which category they belong and are corresponding only shown there in the GUI.<br />
<br />
"Description" holds a text describing the parameter and it options. It is formatted as html, so source code examples can be embedded via <pre></pre> for example. This text is shown as tool tip for each parameter.<br />
<br />
"EditorType" defines whether the parameter is boolean, numeric, string or multiple.<br />
<br />
"ValueDefault" is the default value that is normally used by the indenter if this parameter is not defined. It is needed if the config file of an indenter is loaded but this parameter value is not defined there. For boolean 0 is equal to false and 1 is equal to true. In case of multiple the number defines which of the multiple choice parameters is selected, starting with 0.<br />
<br />
"Enabled" is not used for boolean but for all other parameters. Defines whether the value should be written to the indenters config file or not. If it is disabled it will not be written and the indenter uses its default value.<br />
<br />
<br />
3.1. Boolean parameters<br />
<br />
Example:<br />
</p>
<pre>
[ANSI style formatting]
Category=0
Description="<html>ANSI style formatting/indenting.</html>"
EditorType=boolean
TrueFalse="--style=ansi|"
Value=0
ValueDefault=0
</pre>
<p>
The only special here is the key "TrueFalse". The string is a parameter list always consists of two parameters devided by a "|" sign, where the first one defines the true case and the second the false case. Some indenters like GreatCode have a parameter for true and false, some other like AStyle in this example only have a parameter for the false case, so the second parameter is empty.<br />
<br />
<br />
3.2. Numeric parameters<br />
</p>
<pre>
[Indent spaces]
CallName="--indent=spaces="
Category=1
Description="<html>Indent using # spaces per indent</html>"
EditorType=numeric
Enabled=false
MaxVal=20
MinVal=2
Value=4
ValueDefault=4
</pre>
<p>
Numeric parameters have defined a maximum value "MaxVal" and a minimum value "MinVal" which can/should not be exceeded. The "CallName" is the parameter as string as it will be written to the indenters config file. At its ending "Value" will be appended.<br />
<br />
<br />
3.3. String parameters<br />
</p>
<pre>
[Comment separation char]
CallName=-cmt_sep_char_4-
Category=5
Description="<html>Set the special character to fill automatic comments.</html>"
EditorType=string
Enabled=true
Value=*
ValueDefault=*
</pre>
<p>
The "CallName" is the parameter as string as it will be written to the indenters config file. At its ending "Value" will be appended. Value can also be a list of strings separated by the "|" sign. By this the parameter is written to the config file with each value in the list. <br />
In the upper example value could be "C|c|K". The result in the ouput file would be:<br />
-cmt_sep_char_4-C
-cmt_sep_char_4-c
-cmt_sep_char_4-K
<br />
<br />
<br />
3.4. Multiple parameters<br />
</p>
<pre>
[Bracket style]
Category=1
Choices="--brackets=break|--brackets=attach|--brackets=linux|--brackets=break-closing-headers"
ChoicesReadable="Break brackets|Attach brackets|Break brackets Linux like|Break closing headers"
Description="<html>Sets the bracket style.</html>"
EditorType=multiple
Enabled=false
Value=1
ValueDefault=-1
</pre>
<p>
Multiple parameters can have exactly one parameter out of a list selected. "Choices" is a parameter list consisting of parameters devided by a "|" sign. Each parameter in the list will be exactly written to the indenters config file as defined here. The list "ChoicesReadable" can be used to show more readable text in the combo box, instead of the "Choices" text. "ChoicesReadable" must have as many entries as "Choices".<br />
</p>
</body>
</html>
|