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 3.0 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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
  12. <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s.
  13. Can also be used as a condition. <b>Since Ant 1.6.3</b></p>
  14. <h3>Parameters</h3>
  15. <table border="1" cellpadding="2" cellspacing="0">
  16. <tr>
  17. <td valign="top"><b>Attribute</b></td>
  18. <td valign="top"><b>Description</b></td>
  19. <td align="center" valign="top"><b>Required</b></td>
  20. </tr>
  21. <tr>
  22. <td valign="top">property</td>
  23. <td valign="top">The property to set. If omitted
  24. the results are written to the log. Ignored when
  25. processing as a condition.</td>
  26. <td valign="top" align="center">No</td>
  27. </tr>
  28. <tr>
  29. <td valign="top">file</td>
  30. <td valign="top">Single file whose length to report.</td>
  31. <td valign="top" align="center" rowspan="2">One of these,
  32. or one or more nested filesets</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">string</td>
  36. <td valign="top">The string whose length to report.</td>
  37. </tr>
  38. <tr>
  39. <td valign="top">mode</td>
  40. <td valign="top">File length mode; when &quot;all&quot; the resulting
  41. value is the sum of all included resources' lengths; when &quot;each&quot;
  42. the task outputs the absolute path and length of each included resource,
  43. one per line. Ignored when processing as a condition.</td>
  44. <td valign="top" align="center">No; default is &quot;all&quot;</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">trim</td>
  48. <td valign="top">Whether to trim when operating on a string.</td>
  49. <td valign="top" align="center">No; only valid when string is set</td>
  50. </tr>
  51. <tr>
  52. <td valign="top">length</td>
  53. <td valign="top">Comparison length for processing as a condition.</td>
  54. <td valign="top" align="center">Yes, in condition mode</td>
  55. </tr>
  56. <tr>
  57. <td valign="top">when</td>
  58. <td valign="top">Comparison type: "equal", "eq", "greater", "gt", "less",
  59. "lt", "ge" (greater or equal), "ne" (not equal), "le" (less or equal)
  60. for use when operating as a condition.</td>
  61. <td valign="top" align="center">No; default is "equal"</td>
  62. </tr>
  63. </table>
  64. <h3>Parameters specified as nested elements</h3>
  65. <h4>Resource Collections</h4>
  66. <p>You can include resources via nested
  67. <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s.</p>
  68. <h3>Examples</h3>
  69. <pre>&lt;length string=&quot;foo&quot; property=&quot;length.foo&quot; /&gt;
  70. </pre>
  71. <p>Stores the length of the string &quot;foo&quot; in the property named
  72. <i>length.foo</i>.</p>
  73. <pre>&lt;length file=&quot;bar&quot; property=&quot;length.bar&quot; /&gt;
  74. </pre>
  75. <p>Stores the length of file &quot;bar&quot; in the property named
  76. <i>length.bar</i>.</p>
  77. <hr>
  78. <p align="center">Copyright &copy; 2005 The Apache Software Foundation.
  79. All rights Reserved.</p>
  80. </body>
  81. </html>