| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Ant-contrib Tasks: IniFile</title> |
| 5 | </head> |
| 6 | |
| 7 | <body> |
| 8 | <h1>IniFile</h1> |
| 9 | |
| 10 | <p>Build and Edit Windows .ini files. Only the simple edits, |
| 11 | <code>remove</code> and <code>set</code> are allowed. Set |
| 12 | has limited computation capability which is described later.</p> |
| 13 | |
| 14 | <h2>Parameters</h2> |
| 15 | <table border="1" cellpadding="2" cellspacing="0"> |
| 16 | <tr> |
| 17 | <th>Attribute</th> |
| 18 | <th>Description</th> |
| 19 | <th>Required</th> |
| 20 | </tr> |
| 21 | <tr> |
| 22 | <td valign="top">source</td> |
| 23 | <td valign="top">The name source .ini file to read in.</td> |
| 24 | <td align="center" valign="top">No.</td> |
| 25 | </tr> |
| 26 | <tr> |
| 27 | <td valign="top">dest</td> |
| 28 | <td valign="top">The name destination .ini file to write.</td> |
| 29 | <td align="center" valign="top">Yes.</td> |
| 30 | </tr> |
| 31 | </table> |
| 32 | |
| 33 | |
| 34 | <h2>Parameters specified as nested elements</h2> |
| 35 | |
| 36 | <code>remove</code> |
| 37 | <table border="1" cellpadding="2" cellspacing="0"> |
| 38 | <tr> |
| 39 | <th>Attribute</th> |
| 40 | <th>Description</th> |
| 41 | <th>Required</th> |
| 42 | </tr> |
| 43 | <tr> |
| 44 | <td valign="top">section</td> |
| 45 | <td valign="top">The name of the section</td> |
| 46 | <td align="center" valign="top">Yes.</td> |
| 47 | </tr> |
| 48 | <tr> |
| 49 | <td valign="top">property</td> |
| 50 | <td valign="top">The name property.</td> |
| 51 | <td align="center" valign="top">No. If not supplied, the entire |
| 52 | section will be removed</td> |
| 53 | </tr> |
| 54 | </table> |
| 55 | |
| 56 | <code>set</code> |
| 57 | <table border="1" cellpadding="2" cellspacing="0"> |
| 58 | <tr> |
| 59 | <th>Attribute</th> |
| 60 | <th>Description</th> |
| 61 | <th>Required</th> |
| 62 | </tr> |
| 63 | <tr> |
| 64 | <td valign="top">section</td> |
| 65 | <td valign="top">The name of the section</td> |
| 66 | <td align="center" valign="top">Yes.</td> |
| 67 | </tr> |
| 68 | <tr> |
| 69 | <td valign="top">property</td> |
| 70 | <td valign="top">The name property.</td> |
| 71 | <td align="center" valign="top">Yes.</td> |
| 72 | </tr> |
| 73 | <tr> |
| 74 | <td valign="top">value</td> |
| 75 | <td valign="top">The value to set the property to.</td> |
| 76 | <td align="center" valign="top">No, if |
| 77 | <code>operation</code> is specified.</td> |
| 78 | </tr> |
| 79 | <tr> |
| 80 | <td valign="top">operation</td> |
| 81 | <td valign="top">The operation to perform on the existing value. |
| 82 | Possible values are "+" and "-", which add and subtract 1, |
| 83 | respectively from the existing value. If the value doesn't |
| 84 | already exist, the set is not performed.</td> |
| 85 | <td align="center" valign="top">No, if <code>value</code> |
| 86 | is specified.</td> |
| 87 | </tr> |
| 88 | </table> |
| 89 | |
| 90 | <h2>Example</h2> |
| 91 | |
| 92 | |
| 93 | |
| 94 | <pre><code> |
| 95 | |
| 96 | <inifile source="myprog.ini" dest="myprog.new.ini"> |
| 97 | <set section="Section1" property="release-date" value="${todays.date}" /> |
| 98 | <set section="Section1" property="build-number" operation="+" /> |
| 99 | <remove section="Section2" property="useless" /> |
| 100 | <remove section="OutdatedSection" /> |
| 101 | </inifile> |
| 102 | </code></pre> |
| 103 | |
| 104 | |
| 105 | <hr> |
| 106 | <p align="center">Copyright © 2002-2003 Ant-Contrib Project. All |
| 107 | rights Reserved.</p> |
| 108 | |
| 109 | </body> |
| 110 | </html> |