typinfo.xml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539
  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="typinfo">
  22. <short>Access Run-Time Type Information (RTTI)</short>
  23. <!-- \FPCexampledir{typinfex} -->
  24. <descr>
  25. <p>
  26. The <file>TypeInfo</file> unit contains many routines which can be used for
  27. the querying of the Run-Time Type Information (RTTI) which is generated
  28. by the compiler for classes that are compiled under the <var>{$M+}</var>
  29. switch. This information can be used to retrieve or set property values
  30. for published properties for totally unknown classes. In particular, it
  31. can be used to stream classes. The <var>TPersistent</var> class in the
  32. <file>Classes</file> unit is compiled in the <var>{$M+}</var> state and serves
  33. as the base class for all classes that need to be streamed.
  34. </p>
  35. <p>
  36. The unit should be compatible to the Delphi 5 unit with the same name.
  37. The only calls that are still missing are the Variant calls, since Free Pascal
  38. does not support the variant type yet.
  39. </p>
  40. <p>
  41. The examples in this chapter use a <file>rttiobj</file> file, which contains
  42. an object that has a published property of all supported types. It also
  43. contains some auxiliary routines and definitions.
  44. </p>
  45. </descr>
  46. <topic name="ExaminePropInfo">
  47. <short>Examining published property information</short>
  48. <descr>
  49. <p>
  50. Functions for retrieving or examining property information
  51. </p>
  52. <table>
  53. <th><td>Name</td><td>Description</td></th>
  54. <tr><td><link id="FindPropInfo"/></td><td>Getting property type information, With error checking.</td></tr>
  55. <tr><td><link id="GetPropInfo"/></td><td>Getting property type information, No error checking.</td></tr>
  56. <tr><td><link id="GetPropInfos"/></td><td>Find property information of a certain kind</td></tr>
  57. <tr><td><link id="GetObjectPropClass"/></td><td>Return the declared class of an object property </td></tr>
  58. <tr><td><link id="GetPropList"/></td><td>Get a list of all published properties</td></tr>
  59. <tr><td><link id="IsPublishedProp"/></td><td>Is a property published</td></tr>
  60. <tr><td><link id="IsStoredProp"/></td><td>Is a property stored</td></tr>
  61. <tr><td><link id="PropIsType"/></td><td>Is a property of a certain kind</td></tr>
  62. <tr><td><link id="PropType"/></td><td>Return the type of a property</td></tr>
  63. </table>
  64. </descr>
  65. </topic>
  66. <topic name="ManipulatePropValues">
  67. <short>Getting or setting property values</short>
  68. <descr>
  69. <p>
  70. Functions to set or set a property's value.
  71. </p>
  72. <table>
  73. <th><td>Name</td><td>Description</td></th>
  74. <tr><td><link id="GetEnumProp"/></td><td>Return the value of an enumerated type property</td></tr>
  75. <tr><td><link id="GetFloatProp"/></td><td>Return the value of a float property</td></tr>
  76. <tr><td><link id="GetInt64Prop"/></td><td>Return the value of an Int64 property</td></tr>
  77. <tr><td><link id="GetMethodProp"/></td><td>Return the value of a procedural type property</td></tr>
  78. <tr><td><link id="GetObjectProp"/></td><td>Return the value of an object property</td></tr>
  79. <tr><td><link id="GetOrdProp"/></td><td>Return the value of an ordinal type property</td></tr>
  80. <tr><td><link id="GetPropValue"/></td><td>Return the value of a property as a variant</td></tr>
  81. <tr><td><link id="GetSetProp"/></td><td>Return the value of a set property</td></tr>
  82. <tr><td><link id="GetStrProp"/></td><td>Return the value of a string property</td></tr>
  83. <tr><td><link id="GetVariantProp"/></td><td>Return the value of a variant property</td></tr>
  84. <tr><td><link id="SetEnumProp"/></td><td>Set the value of an enumerated type property</td></tr>
  85. <tr><td><link id="SetFloatProp"/></td><td>Set the value of a float property</td></tr>
  86. <tr><td><link id="SetInt64Prop"/></td><td>Set the value of an Int64 property</td></tr>
  87. <tr><td><link id="SetMethodProp"/></td><td>Set the value of a procedural type property</td></tr>
  88. <tr><td><link id="SetObjectProp"/></td><td>Set the value of an object property</td></tr>
  89. <tr><td><link id="SetOrdProp"/></td><td>Set the value of an ordinal type property</td></tr>
  90. <tr><td><link id="SetPropValue"/></td><td>Set the value of a property trhough a variant</td></tr>
  91. <tr><td><link id="SetSetProp"/></td><td>Set the value of a set property</td></tr>
  92. <tr><td><link id="SetStrProp"/></td><td>Set the value of a string property</td></tr>
  93. <tr><td><link id="SetVariantProp"/></td><td>Set the value of a variant property</td></tr>
  94. </table>
  95. </descr>
  96. </topic>
  97. <topic name="AuxiliaryTypinfo">
  98. <short>Auxiliary functions</short>
  99. <descr>
  100. <p>
  101. Other typinfo related functions.
  102. </p>
  103. <table>
  104. <th><td>Name</td><td>Description</td></th>
  105. <tr><td><link id="GetEnumName"/></td><td>Get an enumerated type element name</td></tr>
  106. <tr><td><link id="GetEnumValue"/></td><td>Get ordinal number of an enumerated tye, based on the name.</td></tr>
  107. <tr><td><link id="GetTypeData"/></td><td>Skip type name and return a pointer to the type data</td></tr>
  108. <tr><td><link id="SetToString"/></td><td>Convert a set to its string representation</td></tr>
  109. <tr><td><link id="StringToSet"/></td><td>Convert a string representation of a set to a set</td></tr>
  110. </table>
  111. </descr>
  112. </topic>
  113. <element name="BooleanIdents">
  114. <short>Names for boolean values</short>
  115. </element>
  116. <element name="DotSep">
  117. <short>Name separator character</short>
  118. </element>
  119. <element name="ptField">
  120. <short>Property acces directly from field</short>
  121. </element>
  122. <element name="ptStatic">
  123. <short>Property acces via static method</short>
  124. </element>
  125. <element name="ptVirtual">
  126. <short>Property acces via virtual method</short>
  127. </element>
  128. <element name="ptConst">
  129. <short>Constant used in acces method</short>
  130. </element>
  131. <element name="tkAny">
  132. <short>Any property type</short>
  133. </element>
  134. <element name="tkMethods">
  135. <short>Only method properties. (event handlers)</short>
  136. </element>
  137. <element name="tkProperties">
  138. <short>Real properties. (not methods)</short>
  139. </element>
  140. <element name="PShortString">
  141. <short>Pointer to shortstring</short>
  142. </element>
  143. <element name="PByte">
  144. <short>Pointer to byte</short>
  145. </element>
  146. <element name="PWord">
  147. <short>Pointer to Word</short>
  148. </element>
  149. <element name="PLongint">
  150. <short>Pointer to longint</short>
  151. </element>
  152. <element name="PBoolean">
  153. <short>Pointer to boolean</short>
  154. </element>
  155. <element name="PSingle">
  156. <short>Pointer to single</short>
  157. </element>
  158. <element name="PDouble">
  159. <short>Pointer to double</short>
  160. </element>
  161. <element name="PExtended">
  162. <short>Pointer to extended</short>
  163. </element>
  164. <element name="PComp">
  165. <short>Pointer to comp</short>
  166. </element>
  167. <element name="PFixed16">
  168. <short>Pointer to Fixed16</short>
  169. </element>
  170. <element name="Variant">
  171. <short>Dummy type. Do not use.</short>
  172. </element>
  173. <element name="TTypeKind">
  174. <short>Type of a property.</short>
  175. </element>
  176. <element name="tkString">
  177. <short>Alias for the <var>tsSString</var> enumeration value</short>
  178. </element>
  179. <element name="TTypeKind.tkUnknown">
  180. <short>Unknown property type.</short>
  181. </element>
  182. <element name="TTypeKind.tkInteger">
  183. <short>Integer property.</short>
  184. </element>
  185. <element name="TTypeKind.tkChar">
  186. <short>Char property.</short>
  187. </element>
  188. <element name="TTypeKind.tkEnumeration">
  189. <short>Enumeration type property.</short>
  190. </element>
  191. <element name="TTypeKind.tkFloat">
  192. <short>Float property.</short>
  193. </element>
  194. <element name="TTypeKind.tkSet">
  195. <short>Set property.</short>
  196. </element>
  197. <element name="TTypeKind.tkMethod">
  198. <short>Method property.</short>
  199. </element>
  200. <element name="TTypeKind.tkSString">
  201. <short>Shortstring property.</short>
  202. </element>
  203. <element name="TTypeKind.tkLString">
  204. <short>Longstring property.</short>
  205. </element>
  206. <element name="TTypeKind.tkAString">
  207. <short>Ansistring property.</short>
  208. </element>
  209. <element name="TTypeKind.tkWString">
  210. <short>Widestring property.</short>
  211. </element>
  212. <element name="TTypeKind.tkVariant">
  213. <short>Variant property.</short>
  214. </element>
  215. <element name="TTypeKind.tkArray">
  216. <short>Array property.</short>
  217. </element>
  218. <element name="TTypeKind.tkRecord">
  219. <short>Record property.</short>
  220. </element>
  221. <element name="TTypeKind.tkInterface">
  222. <short>Interface property.</short>
  223. </element>
  224. <element name="TTypeKind.tkClass">
  225. <short>Class property.</short>
  226. </element>
  227. <element name="TTypeKind.tkObject">
  228. <short>Object property.</short>
  229. </element>
  230. <element name="TTypeKind.tkWChar">
  231. <short>Widechar property.</short>
  232. </element>
  233. <element name="TTypeKind.tkBool">
  234. <short>Boolean property.</short>
  235. </element>
  236. <element name="TTypeKind.tkInt64">
  237. <short>Int64 property.</short>
  238. </element>
  239. <element name="TTypeKind.tkQWord">
  240. <short>QWord property.</short>
  241. </element>
  242. <element name="TTypeKind.tkDynArray">
  243. <short>Dynamical array property.</short>
  244. </element>
  245. <element name="TTypeKind.tkInterfaceRaw">
  246. <short>Raw interface property.</short>
  247. </element>
  248. <element name="TTOrdType">
  249. <short>Size and sign of ordinal property type.</short>
  250. <descr>
  251. If the property is and ordinal type, then <var>TTOrdType</var> determines
  252. the size and sign of the ordinal type:
  253. </descr>
  254. </element>
  255. <element name="TTOrdType.otSByte">
  256. <short>Signed byte</short>
  257. </element>
  258. <element name="TTOrdType.otUByte">
  259. <short>Unsigned byte</short>
  260. </element>
  261. <element name="TTOrdType.otSWord">
  262. <short>Signed word</short>
  263. </element>
  264. <element name="TTOrdType.otUWord">
  265. <short>Unsigned word</short>
  266. </element>
  267. <element name="TTOrdType.otSLong">
  268. <short>Signed longint</short>
  269. </element>
  270. <element name="TTOrdType.otULong">
  271. <short>Unsigned longing (Cardinal)</short>
  272. </element>
  273. <element name="TOrdType">
  274. <short>Alias for <link id="#rtl.typinfo.TTordType">TTordType</link>.</short>
  275. <descr>
  276. If the property is and ordinal type, then <var>TOrdType</var> determines
  277. the size and sign of the ordinal type:
  278. </descr>
  279. </element>
  280. <element name="TOrdType.otSByte">
  281. <short>Signed byte</short>
  282. </element>
  283. <element name="TOrdType.otUByte">
  284. <short>Unsigned byte</short>
  285. </element>
  286. <element name="TOrdType.otSWord">
  287. <short>Signed word</short>
  288. </element>
  289. <element name="TOrdType.otUWord">
  290. <short>Unsigned word</short>
  291. </element>
  292. <element name="TOrdType.otSLong">
  293. <short>Signed longint</short>
  294. </element>
  295. <element name="TOrdType.otULong">
  296. <short>Unsigned longing (Cardinal)</short>
  297. </element>
  298. <element name="TFloatType">
  299. <short>The size of a float type.</short>
  300. </element>
  301. <element name="TFloatType.ftSingle">
  302. <short>Single-sized float</short>
  303. </element>
  304. <element name="TFloatType.ftDouble">
  305. <short>Double-sized float</short>
  306. </element>
  307. <element name="TFloatType.ftExtended">
  308. <short>Extended-size float</short>
  309. </element>
  310. <element name="TFloatType.ftComp">
  311. <short>Comp-type float</short>
  312. </element>
  313. <element name="TFloatType.ftCurr">
  314. <short>Currency-type float</short>
  315. </element>
  316. <element name="TFloatType.ftFixed16">
  317. <short>16-bit float type</short>
  318. </element>
  319. <element name="TFloatType.ftFixed32">
  320. <short>32-bit float type.</short>
  321. </element>
  322. <element name="TMethodKind">
  323. <short>Method type description</short>
  324. </element>
  325. <element name="TMethodKind.mkProcedure">
  326. <short>Procedure method.</short>
  327. </element>
  328. <element name="TMethodKind.mkFunction">
  329. <short>Function method</short>
  330. </element>
  331. <element name="TMethodKind.mkConstructor">
  332. <short>Class constructor</short>
  333. </element>
  334. <element name="TMethodKind.mkDestructor">
  335. <short>Class Desctructor</short>
  336. </element>
  337. <element name="TMethodKind.mkClassProcedure">
  338. <short>Class procedure</short>
  339. </element>
  340. <element name="TMethodKind.mkClassFunction">
  341. <short>Class function</short>
  342. </element>
  343. <element name="TParamFlags">
  344. <short>The kind of parameter for a method</short>
  345. </element>
  346. <element name="TParamFlags.pfVar">
  347. <short>Parameter passed by reference</short>
  348. </element>
  349. <element name="TParamFlags.pfConst">
  350. <short>Parameter passed as const (reference)</short>
  351. </element>
  352. <element name="TParamFlags.pfArray">
  353. <short>Array parameter</short>
  354. </element>
  355. <element name="TParamFlags.pfAddress">
  356. <short>Address is passed</short>
  357. </element>
  358. <element name="TParamFlags.pfReference">
  359. <short>Reference passed</short>
  360. </element>
  361. <element name="TParamFlags.pfOut">
  362. <short>Out (by reference)</short>
  363. </element>
  364. <element name="TIntfFlag">
  365. <short>Type of interface.</short>
  366. </element>
  367. <element name="TIntfFlags">
  368. <short>Set of <link id="TIntfFlag"/>.</short>
  369. </element>
  370. <element name="TIntfFlagsBase">
  371. <short>Set of <link id="TIntfFlag"/>.</short>
  372. </element>
  373. <element name="TIntfFlag.ifHasGuid">
  374. <short>Interface has GUID identifier</short>
  375. </element>
  376. <element name="TIntfFlag.ifDispInterface">
  377. <short>Interface is a dual dispatch interface</short>
  378. </element>
  379. <element name="TIntfFlag.ifDispatch">
  380. <short>Interface is a dispatch interface</short>
  381. </element>
  382. <element name="TTypeKinds">
  383. <short>Set of <link id="TTypeKind"/> enumeration.</short>
  384. </element>
  385. <element name="TTypeInfo">
  386. <short>Type information record</short>
  387. <descr>
  388. <p>
  389. The <var>TypeInfo</var> function returns a pointer to a <var>TTypeInfo</var>
  390. record.
  391. </p>
  392. <p>
  393. Note that the Name field is stored with as much bytes as needed to store the name,
  394. it is not padded to 255 characters.
  395. The type data immediatly follows the <var>TTypeInfo</var> record as a <link
  396. id="TTypeData"/> record.
  397. </p>
  398. </descr>
  399. </element>
  400. <element name="TTypeInfo.Name">
  401. <short>Type name</short>
  402. </element>
  403. <element name="TTypeInfo.Kind">
  404. <short>Type kind</short>
  405. </element>
  406. <element name="PTypeInfo">
  407. <short>Pointer to <link id="TTypeInfo"/> record</short>
  408. </element>
  409. <element name="PPTypeInfo">
  410. <short>Pointer to <link id="PTypeInfo"/> pointer</short>
  411. </element>
  412. <element name="PTypeData">
  413. <short>Pointer to <link id="TTypeData"/> record.</short>
  414. </element>
  415. <element name="TTypeData">
  416. <short>Class properties type data record.</short>
  417. <descr>
  418. <p>
  419. If the typeinfo kind is <var>tkClass</var>, then the property
  420. information follows the <var>UnitName</var> string, as an array of <link
  421. id="TPropInfo"/> records.
  422. </p>
  423. </descr>
  424. </element>
  425. <element name="TPropData">
  426. <short>Property data record</short>
  427. <descr>
  428. The <var>TPropData</var> record is not used, but is provided for completeness and
  429. compatibility with Delphi.
  430. </descr>
  431. </element>
  432. <element name="PPropInfo">
  433. <short>Pointer to <link id="TPropInfo"/> record</short>
  434. </element>
  435. <element name="TPropInfo">
  436. <short>Record describing one published property of a class</short>
  437. <descr>
  438. <p>
  439. The <var>TPropInfo</var> record describes one published property of a class.
  440. The property information of a class are stored as an array of
  441. <var>TPropInfo</var> records.
  442. </p>
  443. <p>
  444. The <var>Name</var> field is stored not with 255 characters, but with just as many characters
  445. as required to store the name.
  446. </p>
  447. </descr>
  448. </element>
  449. <element name="TPropInfo.PropType">
  450. <short>Property type</short>
  451. </element>
  452. <element name="TPropInfo.GetProc">
  453. <short>Read handler</short>
  454. </element>
  455. <element name="TPropInfo.SetProc">
  456. <short>Write handler</short>
  457. </element>
  458. <element name="TPropInfo.StoredProc">
  459. <short>Procedure pointer for stored keyword.</short>
  460. </element>
  461. <element name="TPropInfo.Index">
  462. <short>Index for array properties</short>
  463. </element>
  464. <element name="TPropInfo.Default">
  465. <short>Default value</short>
  466. </element>
  467. <element name="TPropInfo.NameIndex">
  468. <short>Index for indexed properties</short>
  469. </element>
  470. <element name="TPropInfo.PropProcs">
  471. <short>Flags describing property procedures.</short>
  472. </element>
  473. <element name="TPropInfo.Name">
  474. <short>Property name</short>
  475. </element>
  476. <element name="TProcInfoProc">
  477. <short>Property info callback method</short>
  478. </element>
  479. <element name="TPropList">
  480. <short>Array of property information pointers</short>
  481. </element>
  482. <element name="PPropList">
  483. <short>Pointer to <link id="TPropList"/></short>
  484. </element>
  485. <element name="EPropertyError">
  486. <short>Exception raised in case of an error in one of the functions.</short>
  487. </element>
  488. <element name="FindPropInfo">
  489. <short>Return property information by property name.</short>
  490. <descr>
  491. <p>
  492. <var>FindPropInfo</var> examines the published property information of a class and
  493. returns a pointer to the property information for property <var>PropName</var>.
  494. The class to be examined can be specified in one of two ways:
  495. </p>
  496. <dl>
  497. <dt>AClass</dt><dd> a class pointer.</dd>
  498. <dt>Instance</dt><dd> an instance of the class to be investigated.</dd>
  499. </dl>
  500. <p>
  501. If the property does not exist, a <var>EPropertyError</var> exception will be
  502. raised. The <link id="GetPropInfo"/> function has the same function as the
  503. <var>FindPropInfo</var> function, but returns <var>Nil</var> if the property does not
  504. exist.
  505. </p>
  506. </descr>
  507. <errors>
  508. Specifying an invalid property name in <var>PropName</var> will result in an
  509. <var>EPropertyError</var> exception.
  510. </errors>
  511. <seealso>
  512. <link id="GetPropInfo"/>
  513. <link id="GetPropList"/>
  514. <link id="GetPropInfos"/>
  515. </seealso>
  516. <example file="typinfex/ex14"/>
  517. </element>
  518. <element name="GetEnumName">
  519. <short>Return name of enumeration constant.</short>
  520. <descr>
  521. <p>
  522. <var>GetEnumName</var> scans the type information for the enumeration type
  523. described by <var>TypeInfo</var> and returns the name of the enumeration
  524. constant for the element with ordinal value equal to <var>Value</var>.
  525. </p>
  526. <p>
  527. If <var>Value</var> is out of range, the first element of the enumeration type
  528. is returned. The result is lowercased, but this may change in the future.
  529. </p>
  530. <p>
  531. This can be used in combination with <var>GetOrdProp</var> to stream a property
  532. of an enumerated type.
  533. </p>
  534. </descr>
  535. <errors>
  536. No check is done to determine whether <var>TypeInfo</var> really points to the
  537. type information for an enumerated type.
  538. </errors>
  539. <seealso>
  540. <link id="GetOrdProp"/>
  541. <link id="GetEnumValue"/>
  542. </seealso>
  543. <example file="typinfex/ex9"/>
  544. </element>
  545. <element name="GetEnumProp">
  546. <short>Return the value of an enumeration type property.</short>
  547. <descr>
  548. <var>GetEnumProp</var> returns the value of an property of an enumerated type
  549. and returns the name of the enumerated value for the objetc <var>Instance</var>.
  550. The property whose value must be returned can be specified by its property
  551. info in <var>PropInfo</var> or by its name in <var>PropName</var>
  552. </descr>
  553. <errors>
  554. No check is done to determine whether <var>PropInfo</var> really points to the
  555. property information for an enumerated type.
  556. Specifying an invalid property name in <var>PropName</var> will result in an
  557. <var>EPropertyError</var> exception.
  558. </errors>
  559. <seealso>
  560. <link id="SetEnumProp"/>
  561. <link id="GetOrdProp"/>
  562. <link id="GetStrProp"/>
  563. <link id="GetInt64Prop"/>
  564. <link id="GetMethodProp"/>
  565. <link id="GetSetProp"/>
  566. <link id="GetObjectProp"/>
  567. <link id="GetEnumProp"/>
  568. </seealso>
  569. <example file="typinfex/ex2"/>
  570. </element>
  571. <element name="GetEnumValue">
  572. <short>Get ordinal value for enumerated type by name</short>
  573. <descr>
  574. <p>
  575. <var>GetEnumValue</var> scans the type information for the enumeration type
  576. described by <var>TypeInfo</var> and returns the ordinal value for the element
  577. in the enumerated type that has identifier <var>Name</var>. The identifier is
  578. searched in a case-insensitive manner.
  579. </p>
  580. <p>
  581. This can be used to set the value of enumerated properties from a stream.
  582. </p>
  583. <p>
  584. For an example, see <link id="GetEnumName"/>.
  585. </p>
  586. </descr>
  587. <errors>
  588. If <var>Name</var> is not found in the list of enumerated values, then -1 is
  589. returned. No check is done whether <var>TypeInfo</var> points to the type information
  590. for an enumerated type.
  591. </errors>
  592. <seealso>
  593. <link id="GetEnumName"/>
  594. <link id="SetOrdProp"/>
  595. </seealso>
  596. </element>
  597. <element name="GetFloatProp">
  598. <short>Return value of floating point property</short>
  599. <descr>
  600. <var>GetFloatProp</var> returns the value of the float property described by
  601. <var>PropInfo</var> or with name <var>Propname</var> for the object <var>Instance</var>.
  602. All float types are converted
  603. to extended.
  604. </descr>
  605. <errors>
  606. No checking is done whether <var>Instance</var> is non-nil, or whether
  607. <var>PropInfo</var> describes a valid float property of <var>Instance</var>.
  608. Specifying an invalid property name in <var>PropName</var> will result in an
  609. <var>EPropertyError</var> exception.
  610. </errors>
  611. <seealso>
  612. <link id="SetFloatProp"/>
  613. <link id="GetOrdProp"/>
  614. <link id="GetStrProp"/>
  615. <link id="GetInt64Prop"/>
  616. <link id="GetMethodProp"/>
  617. <link id="GetSetProp"/>
  618. <link id="GetObjectProp"/>
  619. <link id="GetEnumProp"/>
  620. </seealso>
  621. <example file="typinfex/ex4"/>
  622. </element>
  623. <element name="GetInt64Prop">
  624. <short>return value of an Int64 property</short>
  625. <descr>
  626. <remark>
  627. Publishing of Int64 properties is not yet supported by Free Pascal. This
  628. function is provided for Delphi compatibility only at the moment.
  629. </remark>
  630. <p>
  631. <var>GetInt64Prop</var> returns the value of the property of type
  632. <var>Int64</var> that is described by <var>PropInfo</var> or with name <var>Propname</var>
  633. for the object <var>Instance</var>.
  634. </p>
  635. </descr>
  636. <errors>
  637. No checking is done whether <var>Instance</var> is non-nil, or whether
  638. <var>PropInfo</var> describes a valid <var>Int64</var> property of <var>Instance</var>.
  639. Specifying an invalid property name in <var>PropName</var> will result in an
  640. <var>EPropertyError</var> exception
  641. </errors>
  642. <seealso>
  643. <link id="SetInt64Prop"/>
  644. <link id="GetOrdProp"/>
  645. <link id="GetStrProp"/>
  646. <link id="GetFloatProp"/>
  647. <link id="GetMethodProp"/>
  648. <link id="GetSetProp"/>
  649. <link id="GetObjectProp"/>
  650. <link id="GetEnumProp"/>
  651. </seealso>
  652. <example file="typinfex/ex15"/>
  653. </element>
  654. <element name="GetMethodProp">
  655. <short>Return value of a method property</short>
  656. <descr>
  657. <p>
  658. <var>GetMethodProp</var> returns the method the property described by
  659. <var>PropInfo</var> or with name <var>Propname</var> for object <var>Instance</var>.
  660. The return type <var>TMethod</var> is defined in the <file>SysUtils</file> unit as:
  661. </p>
  662. <code>
  663. TMethod = packed record
  664. Code, Data: Pointer;
  665. end;
  666. </code>
  667. <p>
  668. <var>Data</var> points to the instance of the class with the method <var>Code</var>.
  669. </p>
  670. </descr>
  671. <errors>
  672. No checking is done whether <var>Instance</var> is non-nil, or whether
  673. <var>PropInfo</var> describes a valid method property of <var>Instance</var>.
  674. Specifying an invalid property name in <var>PropName</var> will result in an
  675. <var>EPropertyError</var> exception.
  676. </errors>
  677. <seealso>
  678. <link id="SetMethodProp"/>
  679. <link id="GetOrdProp"/>
  680. <link id="GetStrProp"/>
  681. <link id="GetFloatProp"/>
  682. <link id="GetInt64Prop"/>
  683. <link id="GetSetProp"/>
  684. <link id="GetObjectProp"/>
  685. <link id="GetEnumProp"/>
  686. </seealso>
  687. <example file="typinfex/ex6"/>
  688. </element>
  689. <element name="GetObjectProp">
  690. <short>Return value of an object-type property.</short>
  691. <descr>
  692. <p>
  693. <var>GetObjectProp</var> returns the object which the property described by
  694. <var>PropInfo</var> with name <var>Propname</var> points to for object <var>Instance</var>.
  695. </p>
  696. <p>
  697. If <var>MinClass</var> is specified, then if the object is not descendent of
  698. class <var>MinClass</var>, then <var>Nil</var> is returned.
  699. </p>
  700. </descr>
  701. <errors>
  702. No checking is done whether <var>Instance</var> is non-nil, or whether
  703. <var>PropInfo</var> describes a valid method property of <var>Instance</var>.
  704. Specifying an invalid property name in <var>PropName</var> will result in an
  705. <var>EPropertyError</var> exception.
  706. </errors>
  707. <seealso>
  708. <link id="SetMethodProp"/>
  709. <link id="GetOrdProp"/>
  710. <link id="GetStrProp"/>
  711. <link id="GetFloatProp"/>
  712. <link id="GetInt64Prop"/>
  713. <link id="GetSetProp"/>
  714. <link id="GetObjectProp"/>
  715. <link id="GetEnumProp"/>
  716. </seealso>
  717. <example file="typinfex/ex5"/>
  718. </element>
  719. <element name="GetObjectPropClass">
  720. <short>Return class of property.</short>
  721. <descr>
  722. <p>
  723. <var>GetObjectPropClass</var> returns the declared class of the property with name
  724. <var>PropName</var>. This may not be the actual class of the property value.
  725. </p>
  726. <p>
  727. For an example, see <link id="GetObjectProp"/>.
  728. </p>
  729. </descr>
  730. <errors>
  731. No checking is done whether <var>Instance</var> is non-nil.
  732. Specifying an invalid property name in <var>PropName</var> will result in an
  733. <var>EPropertyError</var> exception.
  734. </errors>
  735. <seealso>
  736. <link id="SetMethodProp"/>
  737. <link id="GetOrdProp"/>
  738. <link id="GetStrProp"/>
  739. <link id="GetFloatProp"/>
  740. <link id="GetInt64Prop"/>
  741. </seealso>
  742. </element>
  743. <element name="GetOrdProp">
  744. <short>Get the value of an ordinal property</short>
  745. <descr>
  746. <p>
  747. <var>GetOrdProp</var> returns the value of the ordinal property described by
  748. <var>PropInfo</var> or with name <var>PropName</var> for the object <var>Instance</var>.
  749. The value is returned as a longint, which should be typecasted to the
  750. needed type.
  751. </p>
  752. <p>
  753. Ordinal properties that can be retrieved include:
  754. </p>
  755. <dl>
  756. <dt>Integers and subranges of integers</dt>
  757. <dd>The value of the integer will be returned.</dd>
  758. <dt>Enumerated types and subranges of enumerated types</dt>
  759. <dd>The ordinal value of the enumerated type will be returned.</dd>
  760. <dt>Sets</dt>
  761. <dd>If the base type of the set has less than 31 possible values.
  762. If a bit is set in the return value, then the corresponding element of the
  763. base ordinal class of the set type must be included in the set.
  764. </dd>
  765. </dl>
  766. </descr>
  767. <errors>
  768. No checking is done whether <var>Instance</var> is non-nil, or whether
  769. <var>PropInfo</var> describes a valid ordinal property of <var>Instance</var>
  770. Specifying an invalid property name in <var>PropName</var> will result in an
  771. <var>EPropertyError</var> exception.
  772. </errors>
  773. <seealso>
  774. <link id="SetOrdProp"/>
  775. <link id="GetStrProp"/>
  776. <link id="GetFloatProp"/>
  777. <link id="GetInt64Prop"/>
  778. <link id="GetMethodProp"/>
  779. <link id="GetSetProp"/>
  780. <link id="GetObjectProp"/>
  781. <link id="GetEnumProp"/>
  782. </seealso>
  783. <example file="typinfex/ex1"/>
  784. </element>
  785. <element name="GetPropInfo">
  786. <short>Return property type information, by property name.</short>
  787. <descr>
  788. <p>
  789. <var>GetPropInfo</var> returns a pointer to the <var>TPropInfo</var> record for a the
  790. <var>PropName</var> property of a class. The class to examine can be specified
  791. in one of three ways:
  792. </p>
  793. <dl>
  794. <dt>Instance</dt><dd> An instance of the class.</dd>
  795. <dt>AClass</dt><dd> A class pointer to the class.</dd>
  796. <dt>TypeInfo</dt><dd> A pointer to the type information of the class.</dd>
  797. </dl>
  798. <p>
  799. In each of these three ways, if <var>AKinds</var> is specified, if the property
  800. has <var>TypeKind</var> which is not included in <var>Akinds</var>, <var>Nil</var> will be
  801. returned.
  802. </p>
  803. <p>
  804. For an example, see most of the other functions.
  805. </p>
  806. </descr>
  807. <errors>
  808. If the property <var>PropName</var> does not exist, <var>Nil</var> is returned.
  809. </errors>
  810. <seealso>
  811. <link id="GetPropInfos"/>
  812. <link id="GetPropList"/>
  813. </seealso>
  814. </element>
  815. <element name="GetPropInfos">
  816. <short>Return a list of published properties.</short>
  817. <descr>
  818. <var>GetPropInfos</var> stores pointers to the property information of all published
  819. properties of a class with class info <var>TypeInfo</var> in the list pointed to by
  820. <var>Proplist</var>. The <var>PropList</var> pointer must point to a memory location that
  821. contains enough space to hold all properties of the class and its parent classes.
  822. </descr>
  823. <errors>
  824. No checks are done to see whether <var>PropList</var> points to a memory area that
  825. is big enough to hold all pointers.
  826. </errors>
  827. <seealso>
  828. <link id="GetPropInfo"/>
  829. <link id="GetPropList"/>
  830. </seealso>
  831. <example file="typinfex/ex12"/>
  832. </element>
  833. <element name="GetPropList">
  834. <short>Return a list of a certain type of published properties.</short>
  835. <descr>
  836. <p>
  837. <var>GetPropList</var> stores pointers to property information of the class with class
  838. info <var>TypeInfo</var> for properties of kind <var>TypeKinds</var> in the list pointed to
  839. by <var>Proplist</var>. <var>PropList</var> must contain enough space to hold all properties.
  840. </p>
  841. <p>
  842. The function returns the number of pointers that matched the criteria and were stored
  843. in <var>PropList</var>.
  844. </p>
  845. </descr>
  846. <errors>
  847. No checks are done to see whether <var>PropList</var> points to a memory area that is big enough
  848. to hold all pointers.
  849. </errors>
  850. <seealso>
  851. <link id="GetPropInfos"/>
  852. <link id="GetPropInfo"/>
  853. </seealso>
  854. <example file="typinfex/ex13"/>
  855. </element>
  856. <element name="GetPropValue">
  857. <short>Get property value as a string.</short>
  858. <descr>
  859. Due to missing <var>Variant</var> support, <var>GetPropValue</var> is not yet implemented.
  860. The declaration is provided for compatibility with Delphi.
  861. </descr>
  862. <errors>
  863. </errors>
  864. <seealso>
  865. </seealso>
  866. </element>
  867. <element name="GetSetProp">
  868. <short>Return the value of a set property.</short>
  869. <descr>
  870. <p>
  871. <var>GetSetProp</var> returns the contents of a set property as a string.
  872. The property to be returned can be specified by it's name in <var>PropName</var>
  873. or by its property information in <var>PropInfo</var>.
  874. </p>
  875. <p>
  876. The returned set is a string representation of the elements in the set as
  877. returned by <link id="SetToString"/>. The <var>Brackets</var> option can be used to
  878. enclose the string representation in square brackets.
  879. </p>
  880. </descr>
  881. <errors>
  882. No checking is done whether <var>Instance</var> is non-nil, or whether
  883. <var>PropInfo</var> describes a valid ordinal property of <var>Instance</var>
  884. Specifying an invalid property name in <var>PropName</var> will result in an
  885. <var>EPropertyError</var> exception.
  886. </errors>
  887. <seealso>
  888. <link id="SetSetProp"/>
  889. <link id="GetStrProp"/>
  890. <link id="GetFloatProp"/>
  891. <link id="GetInt64Prop"/>
  892. <link id="GetMethodProp"/>
  893. </seealso>
  894. <example file="typinfex/ex7"/>
  895. </element>
  896. <element name="GetStrProp">
  897. <short>Return the value of a string property.</short>
  898. <descr>
  899. <var>GetStrProp</var> returns the value of the string property described by
  900. <var>PropInfo</var> or with name <var>PropName</var> for object <var>Instance</var>.
  901. </descr>
  902. <errors>
  903. No checking is done whether <var>Instance</var> is non-nil, or whether
  904. <var>PropInfo</var> describes a valid string property of <var>Instance</var>.
  905. Specifying an invalid property name in <var>PropName</var> will result in an
  906. <var>EPropertyError</var> exception.
  907. </errors>
  908. <seealso>
  909. <link id="SetStrProp"/>
  910. <link id="GetOrdProp"/>
  911. <link id="GetFloatProp"/>,
  912. <link id="GetInt64Prop"/>
  913. <link id="GetMethodProp"/>
  914. </seealso>
  915. <example file="typinfex/ex3"/>
  916. </element>
  917. <element name="GetTypeData">
  918. <short>Return a pointer to type data, based on type information.</short>
  919. <descr>
  920. <var>GetTypeData</var> returns a pointer to the <var>TTypeData</var> record that
  921. follows after the <var>TTypeInfo</var> record pointed to by <var>TypeInfo</var>.
  922. It essentially skips the <var>Kind</var> and <var>Name</var> fields in the
  923. <var>TTypeInfo</var> record.
  924. </descr>
  925. <errors>
  926. None.
  927. </errors>
  928. <seealso>
  929. </seealso>
  930. </element>
  931. <element name="GetVariantProp">
  932. <short>Return the value of a variant property.</short>
  933. <descr>
  934. Due to mising Variant support, the <var>GetVariantProp</var> function is not
  935. yet implemented. Provided for Delphi compatibility only.
  936. </descr>
  937. <errors>
  938. </errors>
  939. <seealso>
  940. <link id="SetVariantProp"/>
  941. </seealso>
  942. </element>
  943. <element name="IsPublishedProp">
  944. <short>Check whether a published property exists.</short>
  945. <descr>
  946. <p>
  947. <var>IsPublishedProp</var> returns true if a class has a published property with
  948. name <var>PropName</var>. The class can be specfied in one of two ways:
  949. </p>
  950. <dl>
  951. <dt>AClass</dt><dd> A class pointer to the class.</dd>
  952. <dt>Instance</dt><dd> An instance of the class.</dd>
  953. </dl>
  954. </descr>
  955. <errors>
  956. No checks are done to ensure <var>Instance</var> or <var>AClass</var> are valid
  957. pointers. Specifying an invalid property name in <var>PropName</var> will result
  958. in an <var>EPropertyError</var> exception.
  959. </errors>
  960. <seealso>
  961. <link id="IsStoredProp"/>
  962. <link id="PropIsType"/>
  963. </seealso>
  964. <example file="typinfex/ex10"/>
  965. </element>
  966. <element name="IsStoredProp">
  967. <short>Check whether a property is stored.</short>
  968. <descr>
  969. <p>
  970. <var>IsStoredProp</var> returns <var>True</var> if the <var>Stored</var> modifier evaluates
  971. to <var>True</var> for the property described by <var>PropInfo</var> or with name
  972. <var>PropName</var> for object <var>Instance</var>.
  973. It returns <var>False</var> otherwise. If the function returns
  974. <var>True</var>, this indicates that the property should be written when
  975. streaming the object <var>Instance</var>.
  976. </p>
  977. <p>
  978. If there was no <var>stored</var> modifier in the declaration of the property,
  979. <var>True</var> will be returned.
  980. </p>
  981. </descr>
  982. <errors>
  983. No checking is done whether <var>Instance</var> is non-nil, or whether
  984. <var>PropInfo</var> describes a valid property of <var>Instance</var>.
  985. Specifying an invalid property name in <var>PropName</var> will result in an
  986. <var>EPropertyError</var> exception.
  987. </errors>
  988. <seealso>
  989. <link id="IsPublishedProp"/>
  990. <link id="PropIsType"/>
  991. </seealso>
  992. <example file="typinfex/ex11"/>
  993. </element>
  994. <element name="PropIsType">
  995. <short>Check the type of a published property.</short>
  996. <descr>
  997. <p>
  998. <var>PropIsType</var> returns <var>True</var> if the property with name <var>PropName</var>
  999. has type <var>TypeKind</var>. It returns <var>False</var> otherwise. The class to be
  1000. examined can be specified in one of two ways:
  1001. </p>
  1002. <dl>
  1003. <dt>AClass</dt><dd> A class pointer. </dd>
  1004. <dt>Instance</dt><dd> An instance of the class.</dd>
  1005. </dl>
  1006. </descr>
  1007. <errors>
  1008. No checks are done to ensure <var>Instance</var> or <var>AClass</var> are valid
  1009. pointers.Specifying an invalid property name in <var>PropName</var> will result
  1010. in an <var>EPropertyError</var> exception.
  1011. </errors>
  1012. <seealso>
  1013. <link id="IsPublishedProp"/>
  1014. <link id="IsStoredProp"/>
  1015. <link id="PropType"/>
  1016. </seealso>
  1017. <example file="typinfex/ex16"/>
  1018. </element>
  1019. <element name="PropType">
  1020. <short>Return the type of a property</short>
  1021. <descr>
  1022. <p>
  1023. <var>Proptype</var> returns the type of the property <var>PropName</var> for a class.
  1024. The class to be examined can be specified in one of 2 ways:
  1025. </p>
  1026. <dl>
  1027. <dt>AClass</dt><dd>A class pointer.</dd>
  1028. <dt>Instance</dt><dd>An instance of the class.</dd>
  1029. </dl>
  1030. </descr>
  1031. <errors>
  1032. No checks are done to ensure <var>Instance</var> or <var>AClass</var> are valid
  1033. pointers. Specifying an invalid property name in <var>PropName</var> will result
  1034. in an <var>EPropertyError</var> exception.
  1035. </errors>
  1036. <seealso>
  1037. <link id="IsPublishedProp"/>
  1038. <link id="IsStoredProp"/>
  1039. <link id="PropIsType"/>
  1040. </seealso>
  1041. <example file="typinfex/ex17"/>
  1042. </element>
  1043. <element name="SetEnumProp">
  1044. <short>Set value of an enumerated-type property</short>
  1045. <descr>
  1046. <p>
  1047. <var>SetEnumProp</var> sets the property described by <var>PropInfo</var> or with name
  1048. <var>PropName</var> to <var>Value</var>. <var>Value</var> must be a string with the name
  1049. of the enumerate value, i.e. it can be used as an argument to
  1050. <link id="GetEnumValue"/>.
  1051. </p>
  1052. <p>
  1053. For an example, see <link id="GetEnumProp"/>.
  1054. </p>
  1055. </descr>
  1056. <errors>
  1057. No checks are done to ensure <var>Instance</var> or <var>PropInfo</var> are valid
  1058. pointers. Specifying an invalid property name in <var>PropName</var> will result
  1059. in an <var>EPropertyError</var> exception.
  1060. </errors>
  1061. <seealso>
  1062. <link id="GetEnumProp"/>
  1063. <link id="SetStrProp"/>
  1064. <link id="SetFloatProp"/>
  1065. <link id="SetInt64Prop"/>
  1066. <link id="SetMethodProp"/>
  1067. </seealso>
  1068. </element>
  1069. <element name="SetFloatProp">
  1070. <short>Set value of a float property.</short>
  1071. <descr>
  1072. <p>
  1073. <var>SetFloatProp</var> assigns <var>Value</var> to the property described by
  1074. <var>PropInfo</var> or with name <var>Propname</var> for the object <var>Instance</var>.
  1075. </p>
  1076. <p>
  1077. For an example, see <link id="GetFloatProp"/>.
  1078. </p>
  1079. </descr>
  1080. <errors>
  1081. No checking is done whether <var>Instance</var> is non-nil, or whether
  1082. <var>PropInfo</var> describes a valid float property of <var>Instance</var>.
  1083. Specifying an invalid property name in <var>PropName</var> will result in an
  1084. <var>EPropertyError</var> exception.
  1085. </errors>
  1086. <seealso>
  1087. <link id="GetFloatProp"/>
  1088. <link id="SetOrdProp"/>
  1089. <link id="SetStrProp"/>,
  1090. <link id="SetInt64Prop"/>
  1091. <link id="SetMethodProp"/>
  1092. </seealso>
  1093. </element>
  1094. <element name="SetInt64Prop">
  1095. <short>Set value of a Int64 property</short>
  1096. <descr>
  1097. <p>
  1098. <var>SetInt64Prop</var> assigns <var>Value</var> to the property of type
  1099. <var>Int64</var> that is described by <var>PropInfo</var> or with name <var>Propname</var>
  1100. for the object <var>Instance</var>.
  1101. </p>
  1102. <p>
  1103. For an example, see <link id="GetInt64Prop"/>.
  1104. </p>
  1105. </descr>
  1106. <errors>
  1107. No checking is done whether <var>Instance</var> is non-nil, or whether
  1108. <var>PropInfo</var> describes a valid <var>Int64</var> property of <var>Instance</var>.
  1109. Specifying an invalid property name in <var>PropName</var> will result in an
  1110. <var>EPropertyError</var> exception.
  1111. </errors>
  1112. <seealso>
  1113. <link id="GetInt64Prop"/>
  1114. <link id="GetMethodProp"/>
  1115. <link id="SetOrdProp"/>
  1116. <link id="SetStrProp"/>
  1117. <link id="SetFloatProp"/>
  1118. </seealso>
  1119. </element>
  1120. <element name="SetMethodProp">
  1121. <short>Set the value of a method property</short>
  1122. <descr>
  1123. <p>
  1124. <var>SetMethodProp</var> assigns <var>Value</var> to the method the property described
  1125. by <var>PropInfo</var> or with name <var>Propname</var> for object <var>Instance</var>.
  1126. </p>
  1127. <p>
  1128. The type <var>TMethod</var> of the <var>Value</var> parameter is defined in the
  1129. <file>SysUtils</file> unit as:
  1130. </p>
  1131. <code>
  1132. TMethod = packed record
  1133. Code, Data: Pointer;
  1134. end;
  1135. </code>
  1136. <p>
  1137. <var>Data</var> should point to the instance of the class with the method <var>Code</var>.
  1138. </p>
  1139. <p>
  1140. For an example, see <link id="GetMethodProp"/>.
  1141. </p>
  1142. </descr>
  1143. <errors>
  1144. No checking is done whether <var>Instance</var> is non-nil, or whether
  1145. <var>PropInfo</var> describes a valid method property of <var>Instance</var>.
  1146. Specifying an invalid property name in <var>PropName</var> will result in an
  1147. <var>EPropertyError</var> exception.
  1148. </errors>
  1149. <seealso>
  1150. <link id="GetMethodProp"/>
  1151. <link id="SetOrdProp"/>
  1152. <link id="SetStrProp"/>
  1153. <link id="SetFloatProp"/>
  1154. <link id="SetInt64Prop"/>
  1155. </seealso>
  1156. </element>
  1157. <element name="SetObjectProp">
  1158. <short>Set the value of an object-type property.</short>
  1159. <descr>
  1160. <p>
  1161. <var>SetObjectProp</var> assigns <var>Value</var> to the the object property described by
  1162. <var>PropInfo</var> or with name <var>Propname</var> for the object <var>Instance</var>.
  1163. </p>
  1164. <p>
  1165. For an example, see <link id="GetObjectProp"/>.
  1166. </p>
  1167. </descr>
  1168. <errors>
  1169. No checking is done whether <var>Instance</var> is non-nil, or whether
  1170. <var>PropInfo</var> describes a valid method property of <var>Instance</var>.
  1171. Specifying an invalid property name in <var>PropName</var> will result in an
  1172. <var>EPropertyError</var> exception.
  1173. </errors>
  1174. <seealso>
  1175. <link id="GetObjectProp"/>
  1176. <link id="SetOrdProp"/>
  1177. <link id="SetStrProp"/>
  1178. <link id="SetFloatProp"/>
  1179. <link id="SetInt64Prop"/>
  1180. <link id="SetMethodProp"/>
  1181. </seealso>
  1182. </element>
  1183. <element name="SetOrdProp">
  1184. <short>Set value of an ordinal property</short>
  1185. <descr>
  1186. <p>
  1187. <var>SetOrdProp</var> assigns <var>Value</var> to the the ordinal property described by
  1188. <var>PropInfo</var> or with name <var>Propname</var> for the object <var>Instance</var>.
  1189. </p>
  1190. <p>
  1191. Ordinal properties that can be set include:
  1192. </p>
  1193. <dl>
  1194. <dt>Integers and subranges of integers</dt>
  1195. <dd>The actual value of the integer must be passed.</dd>
  1196. <dt>Enumerated types and subranges of enumerated types</dt>
  1197. <dd>The ordinal value of the enumerated type must be passed.</dd>
  1198. <dt>Subrange types</dt>
  1199. <dd>of integers or enumerated types. Here the ordinal value must be passed.</dd>
  1200. <dt>Sets</dt>
  1201. <dd> If the base type of the set has less than 31 possible values.
  1202. For each possible value; the corresponding bit of <var>Value</var> must be set.</dd>
  1203. </dl>
  1204. <p>
  1205. For an example, see <link id="GetOrdProp"/>.
  1206. </p>
  1207. </descr>
  1208. <errors>
  1209. No checking is done whether <var>Instance</var> is non-nil, or whether
  1210. <var>PropInfo</var> describes a valid ordinal property of <var>Instance</var>.
  1211. No range checking is performed.
  1212. Specifying an invalid property name in <var>PropName</var> will result in an
  1213. <var>EPropertyError</var> exception.
  1214. </errors>
  1215. <seealso>
  1216. <link id="GetOrdProp"/>
  1217. <link id="SetStrProp"/>
  1218. <link id="SetFloatProp"/>
  1219. <link id="SetInt64Prop"/>
  1220. <link id="SetMethodProp"/>
  1221. </seealso>
  1222. </element>
  1223. <element name="SetPropValue">
  1224. <short>Set property value as variant</short>
  1225. <descr>
  1226. Due to missing Variant support, this function is not yet implemented;
  1227. it is provided for Delphi compatibility only.
  1228. </descr>
  1229. <errors>
  1230. </errors>
  1231. <seealso>
  1232. </seealso>
  1233. </element>
  1234. <element name="SetSetProp">
  1235. <short>Set value of set-typed property.</short>
  1236. <descr>
  1237. <p>
  1238. <var>SetSetProp</var> sets the property specified by <var>PropInfo</var> or
  1239. <var>PropName</var> for object <var>Instance</var> to <var>Value</var>. <var>Value</var> is a
  1240. string which contains a comma-separated list of values, each value being a
  1241. string-representation of the enumerated value that should be included in
  1242. the set. The value should be accepted by the <link id="StringToSet"/> function.
  1243. </p>
  1244. <p>
  1245. The value can be formed using the <link id="SetToString"/> function.
  1246. </p>
  1247. <p>
  1248. For an example, see <link id="GetSetProp"/>.
  1249. </p>
  1250. </descr>
  1251. <errors>
  1252. No checking is done whether <var>Instance</var> is non-nil, or whether
  1253. <var>PropInfo</var> describes a valid ordinal property of <var>Instance</var>.
  1254. No range checking is performed.
  1255. Specifying an invalid property name in <var>PropName</var> will result in an
  1256. <var>EPropertyError</var> exception.
  1257. </errors>
  1258. <seealso>
  1259. <link id="GetSetProp"/>
  1260. <link id="SetOrdProp"/>
  1261. <link id="SetStrProp"/>
  1262. <link id="SetFloatProp"/>
  1263. <link id="SetInt64Prop"/>
  1264. <link id="SetMethodProp"/>
  1265. <link id="SetToString"/>
  1266. <link id="StringToSet"/>
  1267. </seealso>
  1268. </element>
  1269. <element name="SetStrProp">
  1270. <short>Set value of a string property</short>
  1271. <descr>
  1272. <p>
  1273. <var>SetStrProp</var> assigns <var>Value</var> to the string property described by
  1274. <var>PropInfo</var> or with name <var>Propname</var> for object <var>Instance</var>.
  1275. </p>
  1276. <p>
  1277. For an example, see <link id="GetStrProp"/>
  1278. </p>
  1279. </descr>
  1280. <errors>
  1281. No checking is done whether <var>Instance</var> is non-nil, or whether
  1282. <var>PropInfo</var> describes a valid string property of <var>Instance</var>.
  1283. Specifying an invalid property name in <var>PropName</var> will result in an
  1284. <var>EPropertyError</var> exception.
  1285. </errors>
  1286. <seealso>
  1287. <link id="GetStrProp"/>
  1288. <link id="SetOrdProp"/>
  1289. <link id="SetFloatProp"/>,
  1290. <link id="SetInt64Prop"/>
  1291. <link id="SetMethodProp"/>
  1292. </seealso>
  1293. </element>
  1294. <element name="SetToString">
  1295. <short>Convert set to a string description</short>
  1296. <descr>
  1297. <p>
  1298. <var>SetToString</var> takes an integer representation of a set (as received e.g.
  1299. by <var>GetOrdProp</var>) and turns it into a string representing the elements in
  1300. the set, based on the type information found in the <var>PropInfo</var> property
  1301. information. By default, the string representation is not surrounded by
  1302. square brackets. Setting the <var>Brackets</var> parameter to <var>True</var> will
  1303. surround the string representation with brackets.
  1304. </p>
  1305. <p>
  1306. The function returns the string representation of the set.
  1307. </p>
  1308. </descr>
  1309. <errors>
  1310. No checking is done to see whether <var>PropInfo</var> points to valid property
  1311. information.
  1312. </errors>
  1313. <seealso>
  1314. <link id="GetEnumName"/>
  1315. <link id="GetEnumValue"/>
  1316. <link id="StringToSet"/>
  1317. </seealso>
  1318. <example file="typinfex/ex18"/>
  1319. </element>
  1320. <element name="SetVariantProp">
  1321. <short>Set value of a variant property</short>
  1322. <descr>
  1323. Due to missing Variant support, this function is not yet implemented.
  1324. Provided for Delphi compatibility only.
  1325. </descr>
  1326. <errors>
  1327. </errors>
  1328. <seealso>
  1329. </seealso>
  1330. </element>
  1331. <element name="StringToSet">
  1332. <short>Convert string description to a set.</short>
  1333. <descr>
  1334. <p>
  1335. <var>StringToSet</var> converts the string representation of a set in <var>Value</var>
  1336. to a integer representation of the set, using the property information found
  1337. in <var>PropInfo</var>. This property information should point to the property
  1338. information of a set property. The function returns the integer
  1339. representation of the set. (i.e, the set value, typecast to an integer)
  1340. </p>
  1341. <p>
  1342. The string representation can be surrounded with square brackets, and must
  1343. consist of the names of the elements of the base type of the set. The base
  1344. type of the set should be an enumerated type. The elements should be
  1345. separated by commas, and may be surrounded by spaces.
  1346. each of the names will be fed to the <link id="GetEnumValue"/> function.
  1347. </p>
  1348. <p>
  1349. For an example, see <link id="SetToString"/>.
  1350. </p>
  1351. </descr>
  1352. <errors>
  1353. No checking is done to see whether <var>PropInfo</var> points to valid property
  1354. information. If a wrong name is given for an enumerated value, then an
  1355. <var>EPropertyError</var> will be raised.
  1356. </errors>
  1357. <seealso>
  1358. <link id="GetEnumName"/>
  1359. <link id="GetEnumValue"/>
  1360. <link id="SetToString"/>
  1361. </seealso>
  1362. </element>
  1363. </module>
  1364. </package>
  1365. </fpdoc-descriptions>