summaryrefslogtreecommitdiffstats
path: root/docs/manual/tasks/inifile.html
blob: d5722a9c3df693e6203cdd033f61080e6a468d68 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Ant-contrib Tasks: IniFile</title>
  </head>

  <body>
    <h1>IniFile</h1>

    <p>Build and Edit Windows .ini files.  Only the simple edits,
       <code>remove</code> and <code>set</code> are allowed.  Set
       has limited computation capability which is described later.</p>

    <h2>Parameters</h2>
    <table border="1" cellpadding="2" cellspacing="0">
      <tr>
        <th>Attribute</th>
        <th>Description</th>
        <th>Required</th>
      </tr>
      <tr>
        <td valign="top">source</td>
        <td valign="top">The name source .ini file to read in.</td>
        <td align="center" valign="top">No.</td>
      </tr>
      <tr>
        <td valign="top">dest</td>
        <td valign="top">The name destination .ini file to write.</td>
        <td align="center" valign="top">Yes.</td>
      </tr>
    </table>


    <h2>Parameters specified as nested elements</h2>

    <code>remove</code>
    <table border="1" cellpadding="2" cellspacing="0">
      <tr>
        <th>Attribute</th>
        <th>Description</th>
        <th>Required</th>
      </tr>
      <tr>
        <td valign="top">section</td>
        <td valign="top">The name of the section</td>
        <td align="center" valign="top">Yes.</td>
      </tr>
      <tr>
        <td valign="top">property</td>
        <td valign="top">The name property.</td>
        <td align="center" valign="top">No. If not supplied, the entire
           section will be removed</td>
      </tr>
    </table>

    <code>set</code>
    <table border="1" cellpadding="2" cellspacing="0">
      <tr>
        <th>Attribute</th>
        <th>Description</th>
        <th>Required</th>
      </tr>
      <tr>
        <td valign="top">section</td>
        <td valign="top">The name of the section</td>
        <td align="center" valign="top">Yes.</td>
      </tr>
      <tr>
        <td valign="top">property</td>
        <td valign="top">The name property.</td>
        <td align="center" valign="top">Yes.</td>
      </tr>
      <tr>
        <td valign="top">value</td>
        <td valign="top">The value to set the property to.</td>
        <td align="center" valign="top">No, if
           <code>operation</code> is specified.</td>
      </tr>
      <tr>
        <td valign="top">operation</td>
        <td valign="top">The operation to perform on the existing value.
           Possible values are "+" and "-", which add and subtract 1,
           respectively from the existing value.  If the value doesn't
           already exist, the set is not performed.</td>
        <td align="center" valign="top">No, if <code>value</code>
           is specified.</td>
      </tr>
    </table>

    <h2>Example</h2>



<pre><code>

&lt;inifile source="myprog.ini" dest="myprog.new.ini"&gt;
   &lt;set section="Section1" property="release-date" value="${todays.date}" />
   &lt;set section="Section1" property="build-number" operation="+" />
   &lt;remove section="Section2" property="useless" />
   &lt;remove section="OutdatedSection" />
&lt;/inifile&gt;
</code></pre>


    <hr>
    <p align="center">Copyright &copy; 2002-2003 Ant-Contrib Project. All
    rights Reserved.</p>

  </body>
</html>