strings.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <fpdoc-descriptions>
  3. <!--
  4. $Id$
  5. This file is part of the FPC documentation.
  6. Copyright (C) 1997, by Michael Van Canneyt
  7. The FPC documentation is free text; you can redistribute it and/or
  8. modify it under the terms of the GNU Library General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. The FPC Documentation is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Library General Public License for more details.
  15. You should have received a copy of the GNU Library General Public
  16. License along with the FPC documentation; see the file COPYING.LIB. If not,
  17. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. Boston, MA 02111-1307, USA.
  19. -->
  20. <package name="rtl">
  21. <module name="strings">
  22. <short>Null-terminated string (PChar) routines.</short>
  23. <!-- \FPCexampledir{stringex -->
  24. <descr>
  25. <p>
  26. This chapter describes the <var>STRINGS</var> unit for Free Pascal.
  27. This unit is system independent, and therefore works on all supported
  28. platforms.
  29. </p>
  30. </descr>
  31. <element name="StrAlloc">
  32. <short>Allocate memory for a new null-terminated string on the heap</short>
  33. <descr>
  34. <var>StrAlloc</var> reserves memory on the heap for a string with length <var>Len</var>,
  35. terminating <var>#0</var> included, and returns a pointer to it.
  36. </descr>
  37. <errors>
  38. If there is not enough memory, a run-time error occurs.
  39. </errors>
  40. <seealso>
  41. <link id="StrNew"/>
  42. <link id="StrPCopy"/>.
  43. </seealso>
  44. </element>
  45. <element name="StrCat">
  46. <short>Concatenate 2 null-terminated strings.</short>
  47. <descr>
  48. Attaches <var>Source</var> to <var>Dest</var> and returns <var>Dest</var>.
  49. </descr>
  50. <errors>
  51. No length checking is performed.
  52. </errors>
  53. <seealso>
  54. <link id="StrLCat"/>
  55. </seealso>
  56. <example file="stringex/ex11"/>
  57. </element>
  58. <element name="StrComp">
  59. <short>Compare 2 null-terminated strings, case sensitive.</short>
  60. <descr>
  61. <p>
  62. Compares the null-terminated strings <var>S1</var> and <var>S2</var>.
  63. The result is
  64. </p>
  65. <ul>
  66. <li> A negative <var>Longint</var> when <var>S1&lt;S2</var>.
  67. </li>
  68. <li> 0 when <var>S1=S2</var>.
  69. </li>
  70. <li> A positive <var>Longint</var> when <var>S1&gt;S2</var>.
  71. </li>
  72. </ul>
  73. <p>
  74. For an example, see <link id="StrLComp"/>.
  75. </p>
  76. </descr>
  77. <errors>
  78. None.
  79. </errors>
  80. <seealso>
  81. <link id="StrLComp"/>
  82. <link id="StrIComp"/>
  83. <link id="StrLIComp"/>
  84. </seealso>
  85. </element>
  86. <element name="StrCopy">
  87. <short>Copy a null-terminated string</short>
  88. <descr>
  89. Copy the null terminated string in <var>Source</var> to <var>Dest</var>, and
  90. returns a pointer to <var>Dest</var>. <var>Dest</var> needs enough room to contain
  91. <var>Source</var>, i.e. <var>StrLen(Source)+1</var> bytes.
  92. </descr>
  93. <errors>
  94. No length checking is performed.
  95. </errors>
  96. <seealso>
  97. <link id="StrPCopy"/>
  98. <link id="StrLCopy"/>
  99. <link id="StrECopy"/>
  100. </seealso>
  101. <example file="stringex/ex4"/>
  102. </element>
  103. <element name="StrDispose">
  104. <short>disposes of a null-terminated string on the heap</short>
  105. <descr>
  106. Removes the string in <var>P</var> from the heap and releases the memory.
  107. </descr>
  108. <errors>
  109. None.
  110. </errors>
  111. <seealso>
  112. <link id="StrNew"/>
  113. </seealso>
  114. <example file="stringex/ex17"/>
  115. </element>
  116. <element name="StrECopy">
  117. <short>Copy a null-terminated string, return a pointer to the end.</short>
  118. <descr>
  119. Copies the Null-terminated string in <var>Source</var> to <var>Dest</var>, and
  120. returns a pointer to the end (i.e. the terminating Null-character) of the
  121. copied string.
  122. </descr>
  123. <errors>
  124. No length checking is performed.
  125. </errors>
  126. <seealso>
  127. <link id="StrLCopy"/>
  128. <link id="StrCopy"/>
  129. </seealso>
  130. <example file="stringex/ex6"/>
  131. </element>
  132. <element name="StrEnd">
  133. <short>Return a pointer to the end of a null-terminated string</short>
  134. <descr>
  135. Returns a pointer to the end of <var>P</var>. (i.e. to the terminating
  136. null-character.
  137. </descr>
  138. <errors>
  139. None.
  140. </errors>
  141. <seealso>
  142. <link id="StrLen"/>
  143. </seealso>
  144. <example file="stringex/ex7"/>
  145. </element>
  146. <element name="StrIComp">
  147. <short>Compare 2 null-terminated strings, case insensitive.</short>
  148. <descr>
  149. <p>
  150. Compares the null-terminated strings <var>S1</var> and <var>S2</var>, ignoring case.
  151. The result is
  152. </p>
  153. <ul>
  154. <li> A negative <var>Longint</var> when <var>S1&lt;S2</var>.
  155. </li>
  156. <li> 0 when <var>S1=S2</var>.
  157. </li>
  158. <li> A positive <var>Longint</var> when <var>S1&gt;S2</var>.
  159. </li>
  160. </ul>
  161. </descr>
  162. <errors>
  163. None.
  164. </errors>
  165. <seealso>
  166. <link id="StrLComp"/>
  167. <link id="StrComp"/>
  168. <link id="StrLIComp"/>
  169. </seealso>
  170. <example file="stringex/ex8"/>
  171. </element>
  172. <element name="StrLCat">
  173. <short>Concatenate 2 null-terminated strings, with length boundary.</short>
  174. <descr>
  175. Adds <var>MaxLen</var> characters from <var>Source</var> to <var>Dest</var>, and adds a
  176. terminating null-character. Returns <var>Dest</var>.
  177. </descr>
  178. <errors>
  179. None.
  180. </errors>
  181. <seealso>
  182. <link id="StrCat"/>
  183. </seealso>
  184. <example file="stringex/ex12"/>
  185. </element>
  186. <element name="StrLComp">
  187. <short>Compare limited number of characters of 2 null-terminated strings </short>
  188. <descr>
  189. <p>
  190. Compares maximum <var>L</var> characters of the null-terminated strings
  191. <var>S1</var> and <var>S2</var>.
  192. The result is
  193. </p>
  194. <ul>
  195. <li> A negative <var>Longint</var> when <var>S1&lt;S2</var>.
  196. </li>
  197. <li> 0 when <var>S1=S2</var>.
  198. </li>
  199. <li> A positive <var>Longint</var> when <var>S1&gt;S2</var>.
  200. </li>
  201. </ul>
  202. </descr>
  203. <errors>
  204. None.
  205. </errors>
  206. <seealso>
  207. <link id="StrComp"/>
  208. <link id="StrIComp"/>
  209. <link id="StrLIComp"/>
  210. </seealso>
  211. <example file="stringex/ex8"/>
  212. </element>
  213. <element name="StrLCopy">
  214. <short>Copy a null-terminated string, limited in length.</short>
  215. <descr>
  216. Copies <var>MaxLen</var> characters from <var>Source</var> to <var>Dest</var>, and makes
  217. <var>Dest</var> a null terminated string.
  218. </descr>
  219. <errors>
  220. No length checking is performed.
  221. </errors>
  222. <seealso>
  223. <link id="StrCopy"/>
  224. <link id="StrECopy"/>
  225. </seealso>
  226. <example file="stringex/ex5"/>
  227. </element>
  228. <element name="StrLen">
  229. <short>Length of a null-terminated string.</short>
  230. <descr>
  231. Returns the length of the null-terminated string <var>P</var>.
  232. </descr>
  233. <errors>
  234. None.
  235. </errors>
  236. <seealso>
  237. <link id="StrNew"/>
  238. </seealso>
  239. <example file="stringex/ex1"/>
  240. </element>
  241. <element name="StrLIComp">
  242. <short>Compare limited number of characters in 2 null-terminated strings,
  243. ignoring case.</short>
  244. <descr>
  245. <p>
  246. Compares maximum <var>L</var> characters of the null-terminated strings <var>S1</var>
  247. and <var>S2</var>, ignoring case.
  248. The result is
  249. </p>
  250. <ul>
  251. <li> A negative <var>Longint</var> when <var>S1&lt;S2</var>.
  252. </li>
  253. <li> 0 when <var>S1=S2</var>.
  254. </li>
  255. <li> A positive <var>Longint</var> when <var>S1&gt;S2</var>.
  256. </li>
  257. </ul>
  258. <p>
  259. For an example, see <link id="StrIComp"/>
  260. </p>
  261. </descr>
  262. <errors>
  263. None.
  264. </errors>
  265. <seealso>
  266. <link id="StrLComp"/>
  267. <link id="StrComp"/>
  268. <link id="StrIComp"/>
  269. </seealso>
  270. </element>
  271. <element name="StrLower">
  272. <short>Convert null-terminated string to all-lowercase.</short>
  273. <descr>
  274. Converts <var>P</var> to an all-lowercase string. Returns <var>P</var>.
  275. </descr>
  276. <errors>
  277. None.
  278. </errors>
  279. <seealso>
  280. <link id="StrUpper"/>
  281. </seealso>
  282. <example file="stringex/ex14"/>
  283. </element>
  284. <element name="StrMove">
  285. <short>Move a null-terminated string to new location.</short>
  286. <descr>
  287. Copies <var>MaxLen</var> characters from <var>Source</var> to <var>Dest</var>. No
  288. terminating null-character is copied.
  289. Returns <var>Dest</var>
  290. </descr>
  291. <errors>
  292. None.
  293. </errors>
  294. <seealso>
  295. <link id="StrLCopy"/>
  296. <link id="StrCopy"/>
  297. </seealso>
  298. <example file="stringex/ex10"/>
  299. </element>
  300. <element name="StrNew">
  301. <short>Allocate room for new null-terminated string.</short>
  302. <descr>
  303. Copies <var>P</var> to the Heap, and returns a pointer to the copy.
  304. </descr>
  305. <errors>
  306. Returns <var>Nil</var> if no memory was available for the copy.
  307. </errors>
  308. <seealso>
  309. <link id="StrCopy"/>
  310. <link id="StrDispose"/>
  311. </seealso>
  312. <example file="stringex/ex16"/>
  313. </element>
  314. <element name="StrPas">
  315. <short>Convert a null-terminated string to a shortstring.</short>
  316. <descr>
  317. Converts a null terminated string in <var>P</var> to a Pascal string, and returns
  318. this string. The string is truncated at 255 characters.
  319. </descr>
  320. <errors>
  321. None.
  322. </errors>
  323. <seealso>
  324. <link id="StrPCopy"/>
  325. </seealso>
  326. <example file="stringex/ex3"/>
  327. </element>
  328. <element name="StrPCopy">
  329. <short>Copy a pascal string to a null-terminated string</short>
  330. <descr>
  331. Converts the Pascal string in <var>Source</var> to a Null-terminated
  332. string, and copies it to <var>Dest</var>. <var>Dest</var> needs enough room to contain
  333. the string <var>Source</var>, i.e. <var>Length(Source)+1</var> bytes.
  334. </descr>
  335. <errors>
  336. No length checking is performed.
  337. </errors>
  338. <seealso>
  339. <link id="StrPas"/>
  340. </seealso>
  341. <example file="stringex/ex2"/>
  342. </element>
  343. <element name="StrPos">
  344. <short>Search for a null-terminated substring in a null-terminated
  345. string</short>
  346. <descr>
  347. Returns a pointer to the first occurrence of <var>S2</var> in <var>S1</var>.
  348. If <var>S2</var> does not occur in <var>S1</var>, returns <var>Nil</var>.
  349. </descr>
  350. <errors>
  351. None.
  352. </errors>
  353. <seealso>
  354. <link id="StrScan"/>
  355. <link id="StrRScan"/>
  356. </seealso>
  357. <example file="stringex/ex15"/>
  358. </element>
  359. <element name="StrRScan">
  360. <short>Find last occurrence of a character in a null-terminated string.</short>
  361. <descr>
  362. <p>
  363. Returns a pointer to the last occurrence of the character <var>C</var> in the
  364. null-terminated string <var>P</var>. If <var>C</var> does not occur, returns
  365. <var>Nil</var>.
  366. </p>
  367. <p>
  368. For an example, see <link id="StrScan"/>.
  369. </p>
  370. </descr>
  371. <errors>
  372. None.
  373. </errors>
  374. <seealso>
  375. <link id="StrScan"/>
  376. <link id="StrPos"/>
  377. </seealso>
  378. </element>
  379. <element name="StrScan">
  380. <short>Find first occurrence of a character in a null-terminated string.</short>
  381. <descr>
  382. Returns a pointer to the first occurrence of the character <var>C</var> in the
  383. null-terminated string <var>P</var>. If <var>C</var> does not occur, returns
  384. <var>Nil</var>.
  385. </descr>
  386. <errors>
  387. None.
  388. </errors>
  389. <seealso>
  390. <link id="StrRScan"/>
  391. <link id="StrPos"/>
  392. </seealso>
  393. <example file="stringex/ex13"/>
  394. </element>
  395. <element name="StrUpper">
  396. <short>Convert null-terminated string to all-uppercase</short>
  397. <descr>
  398. <p>
  399. Converts <var>P</var> to an all-uppercase string. Returns <var>P</var>.
  400. </p>
  401. <p>
  402. For an example, see <link id="StrLower"/>
  403. </p>
  404. </descr>
  405. <errors>
  406. None.
  407. </errors>
  408. <seealso>
  409. <link id="StrLower"/>
  410. </seealso>
  411. </element>
  412. </module>
  413. </package>
  414. </fpdoc-descriptions>