You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

length.html 2.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  5. <title>Length Task</title>
  6. </head>
  7. <body>
  8. <h2>Length</h2>
  9. <h3>Description</h3>
  10. <p>Display or set a property containing length information for
  11. a string, a file, or one or more nested filesets. Can also
  12. be used as a condition. <b>Since Ant 1.6.3</b></p>
  13. <h3>Parameters</h3>
  14. <table border="1" cellpadding="2" cellspacing="0">
  15. <tr>
  16. <td valign="top"><b>Attribute</b></td>
  17. <td valign="top"><b>Description</b></td>
  18. <td align="center" valign="top"><b>Required</b></td>
  19. </tr>
  20. <tr>
  21. <td valign="top">property</td>
  22. <td valign="top">The property to set. If omitted
  23. the results are written to the log. Ignored when
  24. processing as a condition.</td>
  25. <td valign="top" align="center">No</td>
  26. </tr>
  27. <tr>
  28. <td valign="top">file</td>
  29. <td valign="top">Single file whose length to report.</td>
  30. <td valign="top" align="center" rowspan="2">One of these,
  31. or one or more nested filesets</td>
  32. </tr>
  33. <tr>
  34. <td valign="top">string</td>
  35. <td valign="top">The string whose length to report.</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">mode</td>
  39. <td valign="top">File length mode; when &quot;all&quot; the resulting
  40. value is the sum of all included files' lengths; when &quot;each&quot;
  41. the task outputs the absolute path and length of each included file,
  42. one per line. Ignored when processing as a condition.</td>
  43. <td valign="top" align="center">No; default is &quot;all&quot;</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">trim</td>
  47. <td valign="top">Whether to trim when operating on a string.</td>
  48. <td valign="top" align="center">No; only valid when string is set</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">length</td>
  52. <td valign="top">Comparison length for processing as a condition.</td>
  53. <td valign="top" align="center">Yes, in condition mode</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">when</td>
  57. <td valign="top">Comparison type: "equal", "greater", "less"
  58. for use when operating as a condition.</td>
  59. <td valign="top" align="center">No; default is "equal"</td>
  60. </tr>
  61. </table>
  62. <h3>Parameters specified as nested elements</h3>
  63. <h4>fileset</h4><p>You can include files via nested
  64. <a href="../CoreTypes/fileset.html">fileset</a>s.</p>
  65. <h3>Examples</h3>
  66. <pre>&lt;length string=&quot;foo&quot; property=&quot;length.foo&quot; /&gt;
  67. </pre>
  68. <p>Stores the length of the string &quot;foo&quot; in the property named
  69. <i>length.foo</i>.</p>
  70. <pre>&lt;length file=&quot;bar&quot; property=&quot;length.bar&quot; /&gt;
  71. </pre>
  72. <p>Stores the length of file &quot;bar&quot; in the property named
  73. <i>length.bar</i>.</p>
  74. <hr>
  75. <p align="center">Copyright &copy; 2005 The Apache Software Foundation.
  76. All rights Reserved.</p>
  77. </body>
  78. </html>