| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478 |
- <?xml version="1.0" encoding="ISO8859-1"?>
- <fpdoc-descriptions>
- <!--
- $Id$
- This file is part of the FPC documentation.
- Copyright (C) 1997, by Michael Van Canneyt
- The FPC documentation is free text; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
- The FPC Documentation is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the FPC documentation; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
- -->
- <package name="rtl">
- <module name="objects">
- <short>TP-Compatible basic Objects.</short>
- <!-- \FPCexampledir{objectex} -->
- <descr>
- <p>
- This document documents the <file>objects</file> unit. The unit was implemented by
- many people, and was mainly taken from the FreeVision sources. It has been
- ported to all supported platforms.
- </p>
- <p>
- The methods and fields that are in a <var>Private</var> part of an object
- declaration have been left out of this documentation.
- </p>
- </descr>
- <element name="stOk">
- <short>Stream error codes: No error</short>
- </element>
- <element name="stError">
- <short>Stream error codes: Access error</short>
- </element>
- <element name="stInitError">
- <short>Stream error codes: Initialize error</short>
- </element>
- <element name="stReadError">
- <short>Stream error codes: Stream read error</short>
- </element>
- <element name="stWriteError">
- <short>Stream error codes: Stream write error</short>
- </element>
- <element name="stGetError">
- <short>Stream error codes: Get object error</short>
- </element>
- <element name="stPutError">
- <short>Stream error codes: Put object error</short>
- </element>
- <element name="stSeekError">
- <short>Stream error codes: Seek error in stream</short>
- </element>
- <element name="stOpenError">
- <short>Stream error codes: Error opening stream</short>
- </element>
- <element name="stCreate">
- <short>Stream initialization mode: Create new file</short>
- </element>
- <element name="stOpenRead">
- <short>Stream initialization mode: Read access only</short>
- </element>
- <element name="stOpenWrite">
- <short>Stream initialization mode: Write access only</short>
- </element>
- <element name="stOpen">
- <short>Stream initialization mode: Read/write access</short>
- </element>
- <element name="coIndexError">
- <short>Collection list error: Index out of range</short>
- </element>
- <element name="coOverflow">
- <short>Collection list error: Overflow</short>
- </element>
- <element name="MaxBytes">
- <short>Maximum data size (in bytes)</short>
- </element>
- <element name="MaxWords">
- <short>Maximum data size (in words)</short>
- </element>
- <element name="MaxPtrs">
- <short>Maximum data size (in pointers)</short>
- </element>
- <element name="MaxReadBytes">
- <short>Maximum data that can be read from a stream (not used)</short>
- </element>
- <element name="MaxCollectionSize">
- <short>Maximum collection size (in items)</short>
- </element>
- <element name="DefaulTPCompatible">
- <short>Is the default stream content TP compatible</short>
- <descr>
- This variable determines whether the default stream is filled or read in a
- TP compatible way. The <var>TPCompatible</var> field can be set on a
- per-stream basis, and is initialized with the <var>DefaulTPCompatible</var>
- value.
- </descr>
- </element>
- <element name="RCollection">
- <short>Default stream record for the <link id="TCollection"/> object.</short>
- </element>
- <element name="RStrCollection">
- <short>Default stream record for the <link id="TStrCollection"/> object.</short>
- </element>
- <element name="RStringCollection">
- <short>Default stream record for the <link id="TStringCollection"/> object.</short>
- </element>
- <element name="RStringList">
- <short>Default stream record for the <link id="TStringList"/> object.</short>
- </element>
- <element name="RStrListMaker">
- <short>Default stream record for the <link id="TStrListMaker"/> object.</short>
- </element>
- <element name="StreamError">
- <short>Pointer to default stream error handler.</short>
- </element>
- <element name="vmtHeaderSize">
- <short>Size of the VMT header in an object (not used).</short>
- </element>
- <element name="MaxTPCompatibleCollectionSize">
- <short>Maximum collection size (in items, same value as in TP)</short>
- </element>
- <element name="TCharSet">
- <short>Generic set of characters type.</short>
- </element>
- <element name="PCharSet">
- <short>Pointer to <link id="TCharSet"/>.</short>
- </element>
- <element name="TByteArray">
- <short>Array with maxmimum allowed number of bytes.</short>
- </element>
- <element name="PByteArray">
- <short>Pointer to <link id="TByteArray"/></short>
- </element>
- <element name="TWordArray">
- <short>Array with maxmimum allowed number of words.</short>
- </element>
- <element name="PWordArray">
- <short>Pointer to <link id="TWordArray"/></short>
- </element>
- <element name="TPointerArray">
- <short>Array with maxmimum allowed number of pointers</short>
- </element>
- <element name="PPointerArray">
- <short>Pointer to <link id="TPointerArray"/></short>
- </element>
- <element name="PString">
- <short>Pointer to a shortstring.</short>
- </element>
- <element name="AsciiZ">
- <short>Filename - null terminated array of characters.</short>
- </element>
- <element name="FNameStr">
- <short>Filename - shortstring version.</short>
- </element>
- <element name="Sw_Word">
- <short>Alias for Cardinal</short>
- </element>
- <element name="Sw_Integer">
- <short>Alias for longint</short>
- </element>
- <element name="WordRec">
- <short>Record describing a Word (in bytes)</short>
- </element>
- <element name="WordRec.Hi">
- <short>High byte of a word</short>
- </element>
- <element name="WordRec.Lo">
- <short>Low byte of a word</short>
- </element>
- <element name="LongRec">
- <short>Record describing a longint (in Words)</short>
- </element>
- <element name="LongRec.Lo">
- <short>Lower word of longint</short>
- </element>
- <element name="LongRec.Hi">
- <short>High word of longint</short>
- </element>
- <element name="PtrRec">
- <short>Record describing a pointer to a memory location.</short>
- </element>
- <element name="PtrRec.Ofs">
- <short>Pointer offset</short>
- </element>
- <element name="PtrRec.Seg">
- <short>Pointer segment</short>
- </element>
- <element name="PStreamRec">
- <short>Pointer to <link id="TStreamRec"/></short>
- </element>
- <element name="TStreamRec">
- <short>Record used in streaming mechanism. </short>
- <descr>
- <var>TSreamRec</var> is used by the <file>Objects</file> unit streaming
- mechanism: when an object is registered, a <var>TStreamRec</var> record is
- added to a list of records. This list is used when objects need to be
- streamed from/streamed to a stream. It contains all the information needed
- to stream the object.
- </descr>
- </element>
- <element name="TStreamRec.ObjType">
- <short>Unique identifier for this object type.</short>
- </element>
- <element name="TStreamRec.VmtLink">
- <short>Pointer to object VMT</short>
- </element>
- <element name="TStreamRec.Load">
- <short>Procedure to call when object must be loaded from a stream</short>
- </element>
- <element name="TStreamRec.Store">
- <short>Procedure to call when object must be stored in a stream.</short>
- </element>
- <element name="TStreamRec.Next">
- <short>Next item in list</short>
- </element>
- <element name="PPoint">
- <short>Pointer to <link id="TPoint"/> record.</short>
- </element>
- <element name="TPoint">
- <short>Record describing a point in a 2 dimensional plane.</short>
- </element>
- <element name="TPoint.X">
- <short>X coordinate</short>
- </element>
- <element name="TPoint.Y">
- <short>Y coordinate</short>
- </element>
- <element name="TItemList">
- <short>Pointer array type used in a <link id="TCollection"/></short>
- </element>
- <element name="TStrIndex">
- <short>Pointer array type used in a <link id="TStringList"/></short>
- </element>
- <element name="TStrIndexRec">
- <short>Record type used in a <link id="TStringList"/> to store the strings</short>
- </element>
- <element name="TStrIndexRec.Key">
- <short>String key value</short>
- </element>
- <element name="TStrIndexRec.Count">
- <short>String character count</short>
- </element>
- <element name="TStrIndexRec.Offset">
- <short>String offset in stream</short>
- </element>
- <element name="NewStr">
- <short>Allocate a copy of a shortstring on the heap.</short>
- <descr>
- <p>
- <var>NewStr</var> makes a copy of the string <var>S</var> on the heap,
- and returns a pointer to this copy. If the string is empty then
- <var>Nil</var> is returned.
- </p>
- <p>
- The allocated memory is not based on the declared size of the string passed
- to <var>NewStr</var>, but is baed on the actual length of the string.
- </p>
- </descr>
- <errors>
- If not enough memory is available, an 'out of memory' error will occur.
- </errors>
- <seealso>
- <link id="DisposeStr"/>
- <link id="SetStr"/>
- </seealso>
- <example file="objectex/ex40"/>
- </element>
- <element name="SetStr">
- <short>Allocate a copy of a shortstring on the heap.</short>
- <descr>
- <p>
- <var>SetStr</var> makes a copy of the string <var>S</var> on the heap and
- returns the pointer to this copy in <var>P</var>. If <var>P</var> pointed to
- another string (i.e. was not <var>Nil</var>, the memory is released first.
- Contrary to <link id="NewStr"/>, if the string is empty then a pointer to
- an empty string is returned.
- </p>
- <p>
- The allocated memory is not based on the declared size of the string passed
- to <var>NewStr</var>, but is based on the actual length of the string.
- </p>
- </descr>
- <errors>
- If not enough memory is available, an 'out of memory' error will occur.
- </errors>
- <seealso>
- <link id="DisposeStr"/>
- <link id="NewStr"/>
- </seealso>
- </element>
- <element name="DisposeStr">
- <short>Dispose of a shortstring which was allocated on the heap.</short>
- <descr>
- <p>
- <var>DisposeStr</var> removes a dynamically allocated string from the heap.
- </p>
- <p>
- For an example, see <link id="NewStr"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="NewStr"/>
- <link id="SetStr"/>
- </seealso>
- </element>
- <element name="Abstract">
- <short>Abstract error handler.</short>
- <descr>
- <p>
- When implementing abstract methods, do not declare them as <var>abstract</var>.
- Instead, define them simply as <var>virtual</var>. In the implementation of such
- abstract methods, call the <var>Abstract</var> procedure. This allows explicit
- control of what happens when an abstract method is called.
- </p>
- <p>
- The current implementation of <var>Abstract</var> terminates the program with
- a run-time error 211.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- </element>
- <element name="RegisterObjects">
- <short>Register standard objects.</short>
- <descr>
- <p>
- <var>RegisterObjects</var> registers the following objects for streaming:
- </p>
- <ol>
- <li> <var>TCollection</var>, see <link id="TCollection"/>.</li>
- <li> <var>TStringCollection</var>, see <link id="TStringCollection"/>.</li>
- <li> <var>TStrCollection</var>, see <link id="TStrCollection"/>.</li>
- </ol>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="RegisterType"/>
- </seealso>
- </element>
- <element name="RegisterType">
- <short>Register new object for streaming.</short>
- <descr>
- <p>
- <var>RegisterType</var> registers a new type for streaming. An object cannot
- be streamed unless it has been registered first.
- The stream record <var>S</var> needs to have the following fields set:
- </p>
- <dl>
- <dt>ObjType: Sw_Word</dt>
- <dd> This should be a unique identifier. Each possible
- type should have it's own identifier.
- </dd>
- <dt>VmtLink: pointer</dt>
- <dd>This should contain a pointer to the VMT (Virtual
- Method Table) of the object you try to register.
- </dd>
- <dt>Load : Pointer</dt>
- <dd> is a pointer to a method that initializes an instance
- of that object, and reads the initial values from a stream. This method
- should accept as it's sole argument a <var>PStream</var> type variable.
- </dd>
- <dt>Store: Pointer</dt>
- <dd>is a pointer to a method that stores an instance of the
- object to a stream. This method should accept as it's sole argument
- a <var>PStream</var> type variable.
- </dd>
- </dl>
- <p>
- The VMT of the object can be retrieved with the
- following expression:
- </p>
- <code>
- VmtLink: Ofs(TypeOf(MyType)^);
- </code>
- </descr>
- <errors>
- In case of error (if a object with the same <var>ObjType</var>) is already
- registered), run-time error 212 occurs.
- </errors>
- <example file="objectex/myobject"/>
- </element>
- <element name="LongMul">
- <short>Overflow safe multiply.</short>
- <descr>
- <var>LongMul</var> multiplies <var>X</var> with <var>Y</var>. The result is of
- type <var>Longint</var>. This avoids possible overflow errors you would normally
- get when multiplying <var>X</var> and <var>Y</var> that are too big.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="LongDiv"/>
- </seealso>
- </element>
- <element name="LongDiv">
- <short>Overflow safe divide</short>
- <descr>
- <var>LongDiv</var> divides <var>X</var> by <var>Y</var>. The result is of
- type <var>Integer</var> instead of type <var>Longint</var>, as you would get
- normally.
- </descr>
- <errors>
- If Y is zero, a run-time error will be generated.
- </errors>
- <seealso>
- <link id="LongMul"/>
- </seealso>
- </element>
- <element name="TRect">
- <short>Describes a rectangular region in a plane.</short>
- </element>
- <element name="TRect.A">
- <short>Top left corner of rectangle</short>
- </element>
- <element name="TRect.B">
- <short>Bottom right corner of rectangle</short>
- </element>
- <element name="TRect.Empty">
- <short>Is the surface of the rectangle zero</short>
- <descr>
- <var>Empty</var> returns <var>True</var> if the rectangle defined by the corner points
- <var>A</var>, <var>B</var> has zero or negative surface.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Equals"/>
- <link id="TRect.Contains"/>
- </seealso>
- <example file="objectex/ex1"/>
- </element>
- <element name="TRect.Equals">
- <short>Do the corners of the rectangles match</short>
- <descr>
- <p>
- <var>Equals</var> returns <var>True</var> if the rectangle has the
- same corner points <var>A,B</var> as the rectangle R, and <var>False</var>
- otherwise.
- </p>
- <p>
- For an example, see <link id="TRect.Empty"/>
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Empty"/>
- <link id="TRect.Contains"/>
- </seealso>
- </element>
- <element name="TRect.Contains">
- <short>Determine if a point is inside the rectangle</short>
- <descr>
- <var>Contains</var> returns <var>True</var> if the point <var>P</var> is contained
- in the rectangle (including borders), <var>False</var> otherwise.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Intersect"/>
- <link id="TRect.Equals"/>
- </seealso>
- </element>
- <element name="TRect.Copy">
- <short>Copy cornerpoints from another rectangle.</short>
- <descr>
- Assigns the rectangle R to the object. After the call to <var>Copy</var>, the
- rectangle R has been copied to the object that invoked <var>Copy</var>.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Assign"/>
- </seealso>
- <example file="objectex/ex2"/>
- </element>
- <element name="TRect.Union">
- <short>Enlarges rectangle to encompas another rectangle.</short>
- <descr>
- <var>Union</var> enlarges the current rectangle so that it becomes the union
- of the current rectangle with the rectangle <var>R</var>.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Intersect"/>
- </seealso>
- <example file="objectex/ex3"/>
- </element>
- <element name="TRect.Intersect">
- <short>Reduce rectangle to intersection with another rectangle</short>
- <descr>
- <var>Intersect</var> makes the intersection of the current rectangle with
- <var>R</var>. If the intersection is empty, then the rectangle is set to the empty
- rectangle at coordinate (0,0).
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Union"/>
- </seealso>
- <example file="objectex/ex4"/>
- </element>
- <element name="TRect.Move">
- <short>Move rectangle along a vector.</short>
- <descr>
- <var>Move</var> moves the current rectangle along a vector with components
- <var>(ADX,ADY)</var>. It adds <var>ADX</var> to the X-coordinate of both corner
- points, and <var>ADY</var> to both end points.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Grow"/>
- </seealso>
- <example file="objectex/ex5"/>
- </element>
- <element name="TRect.Grow">
- <short>Expand rectangle with certain size.</short>
- <descr>
- <p>
- <var>Grow</var> expands the rectangle with an amount <var>ADX</var> in the <var>X</var>
- direction (both on the left and right side of the rectangle, thus adding a
- length 2*ADX to the width of the rectangle), and an amount <var>ADY</var> in
- the <var>Y</var> direction (both on the top and the bottom side of the rectangle,
- adding a length 2*ADY to the height of the rectangle.
- </p>
- <p>
- <var>ADX</var> and <var>ADY</var> can be negative. If the resulting rectangle is empty, it is set
- to the empty rectangle at <var>(0,0)</var>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Move"/>
- </seealso>
- <example file="objectex/ex6"/>
- </element>
- <element name="TRect.Assign">
- <short>Set rectangle corners.</short>
- <descr>
- <p>
- <var>Assign</var> sets the corner points of the rectangle to <var>(XA,YA)</var> and
- <var>(Xb,Yb)</var>.
- </p>
- <p>
- For an example, see <link id="TRect.Copy"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TRect.Copy"/>
- </seealso>
- </element>
- <element name="TObject">
- <short>Basis of all objects</short>
- <descr>
- This type serves as the basic object for all other objects in the
- <file>Objects</file> unit.
- </descr>
- </element>
- <element name="TObject.Init">
- <short>Construct (initialize) a new object</short>
- <descr>
- <p>
- Instantiates a new object of type <var>TObject</var>. It fills the instance up
- with Zero bytes.
- </p>
- <p>
- For an example, see <link id="TObject.Free">Free</link>
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TObject.Free"/>
- <link id="TObject.Done"/>
- </seealso>
- </element>
- <element name="TObject.Free">
- <short>Destroy an object and release all memory.</short>
- <descr>
- <var>Free</var> calls the destructor of the object, and releases the memory
- occupied by the instance of the object.
- </descr>
- <errors>
- No checking is performed to see whether <var>self</var> is <var>nil</var> and whether
- the object is indeed allocated on the heap.
- </errors>
- <seealso>
- <link id="TObject.Init"/>
- <link id="TObject.Done"/>
- </seealso>
- <example file="objectex/ex7"/>
- </element>
- <element name="TObject.Done">
- <short>Destroy an object.</short>
- <descr>
- <p>
- <var>Done</var>, the destructor of <var>TObject</var> does nothing. It is mainly
- intended to be used in the <link id="TObject.Free"/> method.
- </p>
- <p>
- The destructore Done does not free the memory occupied by the object.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TObject.Free"/>
- <link id="TObject.Init"/>
- </seealso>
- <example file="objectex/ex8"/>
- </element>
- <element name="TObject.Is_Object">
- <short>Check whether a pointer points to an object.</short>
- <descr>
- <var>Is_Object</var> returns <var>True</var> if the pointer <var>P</var>
- points to an instance of a <var>TObject</var> descendent, it returns
- <var>false</var> otherwise.
- </descr>
- </element>
- <element name="TStream">
- <short>Base stream class</short>
- <descr>
- <p>
- The <var>TStream</var> object is the ancestor for all streaming objects, i.e.
- objects that have the capability to store and retrieve data.
- </p>
- <p>
- It defines a number of methods that are common to all objects that implement
- streaming, many of them are virtual, and are only implemented in the
- descendent types.
- </p>
- <p>
- Programs should not instantiate objects of type TStream directly, but
- instead instantiate a descendant type, such as <var>TDosStream</var>,
- <var>TMemoryStream</var>.
- </p>
- </descr>
- <seealso>
- <link id="PStream"/>
- <link id="TDosStream"/>
- <link id="TMemoryStream"/>
- </seealso>
- </element>
- <element name="PStream">
- <short>Pointer type to <link id="TStream"/></short>
- </element>
- <element name="TStream.Init">
- <short>Constructor for TStream instance</short>
- <descr>
- <var>Init</var> initializes a TStream instance. Descendent streams should
- always call the inherited <var>Init</var>.
- </descr>
- </element>
- <element name="TStream.Status">
- <short>Current stream status</short>
- </element>
- <element name="TStream.ErrorInfo">
- <short>Additional error info when there is an error.</short>
- </element>
- <element name="TStream.StreamSize">
- <short>Current size of the stream</short>
- </element>
- <element name="TStream.Position">
- <short>Current Stream position</short>
- </element>
- <element name="TStream.TPCompatible">
- <short>If set to <var>True</var> streamed data is written in a TP compatible format.</short>
- </element>
- <element name="TStream.Get">
- <short>Read an object definition from the stream.</short>
- <descr>
- <var>Get</var> reads an object definition from a stream, and returns
- a pointer to an instance of this object.
- </descr>
- <errors>
- On error, <link id="TStream.Status"/> is set, and <var>NIL</var> is returned.
- </errors>
- <seealso>
- <link id="TStream.Put"/>
- </seealso>
- <example file="objectex/ex9"/>
- </element>
- <element name="TStream.StrRead">
- <short>Read a null-terminated string from the stream.</short>
- <descr>
- <var>StrRead</var> reads a string from the stream, allocates memory
- for it, and returns a pointer to a null-terminated copy of the string
- on the heap.
- </descr>
- <errors>
- On error, <var>Nil</var> is returned.
- </errors>
- <seealso>
- <link id="TStream.StrWrite"/>
- <link id="TStream.ReadStr"/>
- </seealso>
- <example file="objectex/ex10"/>
- </element>
- <element name="TStream.GetPos">
- <short>Return current position in the stream</short>
- <descr>
- If the stream's status is <var>stOk</var>, <var>GetPos</var> returns the current
- position in the stream. Otherwise it returns <var>-1</var>
- </descr>
- <errors>
- <var>-1</var> is returned if the status is an error condition.
- </errors>
- <seealso>
- <link id="TStream.Seek"/>
- <link id="TStream.GetSize"/>
- </seealso>
- <example file="objectex/ex11"/>
- </element>
- <element name="TStream.GetSize">
- <short>Return the size of the stream.</short>
- <descr>
- If the stream's status is <var>stOk</var> then <var>GetSize</var> returns
- the size of the stream, otherwise it returns <var>-1</var>.
- </descr>
- <errors>
- <var>-1</var> is returned if the status is an error condition.
- </errors>
- <seealso>
- <link id="TStream.Seek"/>
- <link id="TStream.GetPos"/>
- </seealso>
- <example file="objectex/ex12"/>
- </element>
- <element name="TStream.ReadStr">
- <short>Read a shortstring from the stream.</short>
- <descr>
- <var>ReadStr</var> reads a string from the stream, copies it to the heap
- and returns a pointer to this copy. The string is saved as a pascal
- string, and hence is NOT null terminated.
- </descr>
- <errors>
- On error (e.g. not enough memory), <var>Nil</var> is returned.
- </errors>
- <seealso>
- <link id="TStream.StrRead"/>
- </seealso>
- <example file="objectex/ex13"/>
- </element>
- <element name="TStream.Open">
- <short>Open the stream</short>
- <descr>
- <p>
- <var>Open</var> is an abstract method, that should be overridden by descendent
- objects. Since opening a stream depends on the stream's type this is not
- surprising.
- </p>
- <p>
- For an example, see <link id="TDosStream.Open"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Close"/>
- <link id="TStream.Reset"/>
- </seealso>
- </element>
- <element name="TStream.Close">
- <short>Close the stream</short>
- <descr>
- <p>
- <var>Close</var> is an abstract method, that should be overridden by descendent
- objects. Since Closing a stream depends on the stream's type this is not
- surprising.
- </p>
- <p>
- for an example, see <link id="TDosStream.Open"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Open"/>
- <link id="TStream.Reset"/>
- </seealso>
- </element>
- <element name="TStream.Reset">
- <short>Reset the stream</short>
- <descr>
- <var>Reset</var> sets the stream's status to <var>0</var>, as well as the ErrorInfo
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Open"/>
- <link id="TStream.Close"/>
- </seealso>
- </element>
- <element name="TStream.Flush">
- <short>Flush the stream data from the buffer, if any.</short>
- <descr>
- <p>
- <var>Flush</var> is an abstract method that should be overridden by descendent
- objects. It serves to enable the programmer to tell streams that implement
- a buffer to clear the buffer.
- </p>
- <p>
- for an example, see <link id="TBufStream.Flush"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Truncate"/>
- </seealso>
- </element>
- <element name="TStream.Truncate">
- <short>Truncate the stream size on current position.</short>
- <descr>
- <p>
- <var>Truncate</var> is an abstract procedure that should be overridden by
- descendent objects. It serves to enable the programmer to truncate the
- size of the stream to the current file position.
- </p>
- <p>
- For an example, see <link id="TDosStream.Truncate"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Seek"/>
- </seealso>
- </element>
- <element name="TStream.Put">
- <short>Write an object to the stream.</short>
- <descr>
- <p>
- <var>Put</var> writes the object pointed to by <var>P</var>. <var>P</var> should be
- non-nil. The object type must have been registered with <link id="RegisterType"/>.
- </p>
- <p>
- After the object has been written, it can be read again with <link id="TStream.Get">Get</link>.
- </p>
- <p>
- For an example, see <link id="TStream.Get"/>;
- </p>
- </descr>
- <errors>
- No check is done whether P is <var>Nil</var> or not. Passing <var>Nil</var> will cause
- a run-time error 216 to be generated. If the object has not been registered,
- the status of the stream will be set to <var>stPutError</var>.
- </errors>
- <seealso>
- <link id="TStream.Get"/>
- </seealso>
- </element>
- <element name="TStream.StrWrite">
- <short>Write a null-terminated string to the stream.</short>
- <descr>
- <p>
- <var>StrWrite</var> writes the null-terminated string <var>P</var> to the stream.
- <var>P</var> can only be 65355 bytes long.
- </p>
- <p>
- For an example, see <link id="TStream.StrRead"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.WriteStr"/>
- <link id="TStream.StrRead"/>
- <link id="TStream.ReadStr"/>
- </seealso>
- </element>
- <element name="TStream.WriteStr">
- <short>Write a pascal string to the stream.</short>
- <descr>
- <p>
- <var>StrWrite</var> writes the pascal string pointed to by <var>P</var> to the stream.
- </p>
- <p>
- For an example, see <link id="TStream.ReadStr"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.StrWrite"/>
- <link id="TStream.StrRead"/>
- <link id="TStream.ReadStr"/>
- </seealso>
- </element>
- <element name="TStream.Seek">
- <short>Set stream position.</short>
- <descr>
- <p>
- Seek sets the position to <var>Pos</var>. This position is counted
- from the beginning, and is zero based. (i.e. seeek(0) sets the position
- pointer on the first byte of the stream)
- </p>
- <p>
- For an example, see <link id="TDosStream.Seek"/>.
- </p>
- </descr>
- <errors>
- If <var>Pos</var> is larger than the stream size, <var>Status</var> is set to
- <var>StSeekError</var>.
- </errors>
- <seealso>
- <link id="TStream.GetPos"/>
- <link id="TStream.GetSize"/>
- </seealso>
- </element>
- <element name="TStream.Error">
- <short>Set stream status</short>
- <descr>
- <p>
- <var>Error</var> sets the stream's status to <var>Code</var> and <var>ErrorInfo</var>
- to <var>Info</var>. If the <var>StreamError</var> procedural variable is set,
- <var>Error</var> executes it, passing <var>Self</var> as an argument.
- </p>
- <p>
- This method should not be called directly from a program. It is intended to
- be used in descendent objects.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- </element>
- <element name="TStream.Read">
- <short>Read data from stream to buffer.</short>
- <descr>
- <p>
- <var>Read</var> is an abstract method that should be overridden by descendent
- objects.
- </p>
- <p>
- <var>Read</var> reads <var>Count</var> bytes from the stream into <var>Buf</var>.
- It updates the position pointer, increasing it's value with <var>Count</var>.
- <var>Buf</var> must be large enough to contain <var>Count</var> bytes.
- </p>
- </descr>
- <errors>
- No checking is done to see if <var>Buf</var> is large enough to contain
- <var>Count</var> bytes.
- </errors>
- <seealso>
- <link id="TStream.Write"/>
- <link id="TStream.ReadStr"/>
- <link id="TStream.StrRead"/>
- </seealso>
- <example file="objectex/ex18"/>
- </element>
- <element name="TStream.Write">
- <short>Write a number of bytes to the stream.</short>
- <descr>
- <p>
- <var>Write</var> is an abstract method that should be overridden by descendent
- objects.
- </p>
- <p>
- <var>Write</var> writes <var>Count</var> bytes to the stream from <var>Buf</var>.
- It updates the position pointer, increasing it's value with <var>Count</var>.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- No checking is done to see if <var>Buf</var> actually contains <var>Count</var> bytes.
- </errors>
- <seealso>
- <link id="TStream.Read"/>
- <link id="TStream.WriteStr"/>
- <link id="TStream.StrWrite"/>
- </seealso>
- </element>
- <element name="TStream.CopyFrom">
- <short>Copy data from another stream. </short>
- <descr>
- <var>CopyFrom</var> reads Count bytes from stream <var>S</var> and stores them
- in the current stream. It uses the <link id="TStream.Read">Read</link> method
- to read the data, and the <link id="TStream.Write">Write</link> method to
- write in the current stream.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Read">Read</link>
- <link id="TStream.Write">Write</link>
- </seealso>
- <example file="objectex/ex19"/>
- </element>
- <element name="TDosStream">
- <short>DOS file stream</short>
- <descr>
- <p>
- <var>TDosStream</var> is a stream that stores it's contents in a file.
- it overrides a couple of methods of <link id="TStream"/> for this.
- </p>
- <p>
- In addition to the fields inherited from <var>TStream</var> (see <link id="TStream"/>),
- there are some extra fields, that describe the file. (mainly the name and
- the OS file handle)
- </p>
- <p>
- No buffering in memory is done when using <var>TDosStream</var>.
- All data are written directly to the file. For a stream that buffers
- in memory, see <link id="TBufStream"/>.
- </p>
- </descr>
- </element>
- <element name="TDosStream.Handle">
- <short>OS file handle for stream</short>
- </element>
- <element name="TDosStream.FName">
- <short>File name</short>
- </element>
- <element name="TDosStream.Init">
- <short>Instantiate a new instance of TDosStream.</short>
- <descr>
- <p>
- <var>Init</var> instantiates an instance of <var>TDosStream</var>. The name of the
- file that contains (or will contain) the data of the stream is given in
- <var>FileName</var>. The <var>Mode</var> parameter determines whether a new file
- should be created and what access rights you have on the file.
- It can be one of the following constants:
- </p>
- <dl>
- <dt>stCreate</dt><dd> Creates a new file.</dd>
- <dt>stOpenRead</dt><dd> Read access only.</dd>
- <dt>stOpenWrite</dt><dd> Write access only.</dd>
- <dt>stOpen</dt><dd> Read and write access.</dd>
- </dl>
- <p>
- For an example, see <link id="TDosStream.Truncate"/>.
- </p>
- </descr>
- <errors>
- On error, <link id="TStream.Status">Status</link> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
- is set to the dos error code.
- </errors>
- <seealso>
- <link id="TDosStream.Done"/>
- </seealso>
- </element>
- <element name="TDosStream.Done">
- <short>Closes the file and cleans up the instance.</short>
- <descr>
- <p>
- <var>Done</var> closes the file if it was open and cleans up the
- instance of <var>TDosStream</var>.
- </p>
- <p>
- for an example, see e.g. <link id="TDosStream.Truncate"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TDosStream.Init"/>
- <link id="TDosStream.Close"/>
- </seealso>
- </element>
- <element name="TDosStream.Close">
- <short>Close the file.</short>
- <descr>
- <p>
- <var>Close</var> closes the file if it was open, and sets <var>Handle</var> to -1.
- Contrary to <link id="TDosStream.Done">Done</link> it does not clean up the instance
- of <var>TDosStream</var>
- </p>
- <p>
- For an example, see <link id="TDosStream.Open"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Close"/>
- <link id="TDosStream.Init"/>
- <link id="TDosStream.Done"/>
- </seealso>
- </element>
- <element name="TDosStream.Truncate">
- <short>Truncate the file on the current position.</short>
- <descr>
- If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
- truncate the stream size to the current file position.
- </descr>
- <errors>
- If an error occurs, the stream's status is set to <var>stError</var> and
- <var>ErrorInfo</var> is set to the OS error code.
- </errors>
- <seealso>
- <link id="TStream.Truncate"/>
- <link id="TStream.GetSize"/>
- </seealso>
- <example file="objectex/ex16"/>
- </element>
- <element name="TDosStream.Seek">
- <short>Set file position.</short>
- <descr>
- If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the
- file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
- the beginning of the file.
- </descr>
- <errors>
- In case an error occurs, the stream's status is set to <var>stSeekError</var>,
- and the OS error code is stored in <var>ErrorInfo</var>.
- </errors>
- <seealso>
- <link id="TStream.Seek"/>
- <link id="TStream.GetPos"/>
- </seealso>
- <example file="objectex/ex17"/>
- </element>
- <element name="TDosStream.Open">
- <short>Open the file stream</short>
- <descr>
- If the stream's status is <var>stOK</var>, and the stream is closed then
- <var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
- This call can be used after a <link id="TDosStream.Close">Close</link> call.
- </descr>
- <errors>
- If an error occurs when re-opening the file, then <var>Status</var> is set
- to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
- </errors>
- <seealso>
- <link id="TStream.Open"/>
- <link id="TDosStream.Close"/>
- </seealso>
- <example file="objectex/ex14"/>
- </element>
- <element name="TDosStream.Read">
- <short>Read data from the stream to a buffer.</short>
- <descr>
- <p>
- If the Stream is open and the stream status is <var>stOK</var> then
- <var>Read</var> will read <var>Count</var> bytes from the stream and place them
- in <var>Buf</var>.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
- <var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
- made to read beyond the end of the stream.
- </errors>
- <seealso>
- <link id="TStream.Read"/>
- <link id="TDosStream.Write"/>
- </seealso>
- </element>
- <element name="TDosStream.Write">
- <short>Write data from a buffer to the stream.</short>
- <descr>
- <p>
- If the Stream is open and the stream status is <var>stOK</var> then
- <var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
- in the stream.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
- <var>ErrorInfo</var> gets the OS specific error.
- </errors>
- <seealso>
- <link id="TStream.Write"/>
- <link id="TDosStream.Read"/>
- </seealso>
- </element>
- <element name="PBufStream">
- <short>Pointer to <link id="TBufStream"/> object.</short>
- </element>
- <element name="PDosStream">
- <short>Pointer to <link id="TDosStream"/> object.</short>
- </element>
- <element name="PMemoryStream">
- <short>Pointer to <link id="TMemoryStream"/> object.</short>
- </element>
- <element name="PCollection">
- <short>Pointer to <link id="TCollection"/> object.</short>
- </element>
- <element name="PItemList">
- <short>Pointer to <link id="TItemList"/> object.</short>
- </element>
- <element name="PObject">
- <short>Pointer to <link id="TObject"/> object.</short>
- </element>
- <element name="PRect">
- <short>Pointer to <link id="TRect"/> object.</short>
- </element>
- <element name="PResourceCollection">
- <short>Pointer to <link id="TResourceCollection"/> object.</short>
- </element>
- <element name="PSortedCollection">
- <short>Pointer to <link id="TSortedCollection"/> object.</short>
- </element>
- <element name="PSTrCollection">
- <short>Pointer to <link id="TStrCollection"/> object.</short>
- </element>
- <element name="PSTrListMaker">
- <short>Pointer to <link id="TStrListMaker"/> object.</short>
- </element>
- <element name="PStringCollection">
- <short>Pointer to <link id="TStringCollection"/> object.</short>
- </element>
- <element name="PStringList">
- <short>Pointer to <link id="TStringList"/> object.</short>
- </element>
- <element name="PUnsortedStrCollection">
- <short>Pointer to <link id="TUnsortedStrCollection"/> object.</short>
- </element>
- <element name="PResourceFile">
- <short>Pointer to <link id="TResourceFile"/> object.</short>
- </element>
- <element name="PStrIndex">
- <short>Pointer to <link id="TStrIndex"/> array.</short>
- </element>
- <element name="PObject">
- <short>Pointer to <link id="TObject"/> object.</short>
- </element>
- <element name="TBufStream">
- <short>Buffered file stream</short>
- <descr>
- <p>
- <var>Bufstream</var> implements a buffered file stream. That is, all data written
- to the stream is written to memory first. Only when the buffer is full, or
- on explicit request, the data is written to disk.
- </p>
- <p>
- Also, when reading from the stream, first the buffer is checked if there is
- any unread data in it. If so, this is read first. If not the buffer is
- filled again, and then the data is read from the buffer.
- </p>
- <p>
- The size of the buffer is fixed and is set when constructing the file.
- </p>
- <p>
- This is useful if you need heavy throughput for your stream, because it
- speeds up operations.
- </p>
- </descr>
- <seealso>
- link id
- </seealso>
- </element>
- <element name="TBufStream.LastMode">
- <short>Last file open mode</short>
- </element>
- <element name="TBufStream.BufSize">
- <short>Size of buffer</short>
- </element>
- <element name="TBufStream.BufPtr">
- <short>Pointer to current position in buffer</short>
- </element>
- <element name="TBufStream.Bufend">
- <short>End of data in buffer.</short>
- </element>
- <element name="TBufStream.Buffer">
- <short>Actual buffer</short>
- </element>
- <element name="TBufStream.Init">
- <short>Initialize an instance of <var>TBufStream</var> and open the file.</short>
- <descr>
- <p>
- <var>Init</var> instantiates an instance of <var>TBufStream</var>. The name of the
- file that contains (or will contain) the data of the stream is given in
- <var>FileName</var>. The <var>Mode</var> parameter determines whether a new file
- should be created and what access rights you have on the file.
- It can be one of the following constants:
- </p>
- <dl>
- <dt>stCreate</dt><dd> Creates a new file.</dd>
- <dt>stOpenRead</dt><dd> Read access only.</dd>
- <dt>stOpenWrite</dt><dd> Write access only.</dd>
- <dt>stOpen</dt><dd> Read and write access.</dd>
- </dl>
- <p>
- The <var>Size</var> parameter determines the size of the buffer that will be
- created. It should be different from zero.
- </p>
- <p>
- For an example see <link id="TBufStream.Flush"/>.
- </p>
- </descr>
- <errors>
- On error, <var>Status</var> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
- is set to the dos error code.
- </errors>
- <seealso>
- <link id="TDosStream.Init"/>
- <link id="TBufStream.Done"/>
- </seealso>
- </element>
- <element name="TBufStream.Done">
- <short>Close the file and cleans up the instance.</short>
- <descr>
- <p>
- <var>Done</var> flushes and closes the file if it was open and cleans up the
- instance of <var>TBufStream</var>.
- </p>
- <p>
- For an example see <link id="TBufStream.Flush"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TDosStream.Done"/>
- <link id="TBufStream.Init"/>
- <link id="TBufStream.Close"/>
- </seealso>
- </element>
- <element name="TBufStream.Close">
- <short>Flush data and Close the file.</short>
- <descr>
- <p>
- <var>Close</var> flushes and closes the file if it was open, and sets <var>Handle</var> to -1.
- Contrary to <link id="TBufStream.Done">Done</link> it does not clean up the instance
- of <var>TBufStream</var>
- </p>
- <p>
- For an example see <link id="TBufStream.Flush"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStream.Close"/>
- <link id="TBufStream.Init"/>
- <link id="TBufStream.Done"/>
- </seealso>
- </element>
- <element name="TBufStream.Flush">
- <short>FLush data from buffer, and write it to stream.</short>
- <descr>
- When the stream is in write mode, the contents of the buffer are written to
- disk, and the buffer position is set to zero.
- When the stream is in read mode, the buffer position is set to zero.
- </descr>
- <errors>
- Write errors may occur if the file was in write mode.
- see <link id="TBufStream.Write">Write</link> for more info on the errors.
- </errors>
- <seealso>
- <link id="TStream.Close"/>
- <link id="TBufStream.Init"/>
- <link id="TBufStream.Done"/>
- </seealso>
- <example file="objectex/ex15"/>
- </element>
- <element name="TBufStream.Truncate">
- <short>Flush buffer, and truncate the file at current position.</short>
- <descr>
- <p>
- If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
- flush the buffer, and then truncates the stream size to the current
- file position.
- </p>
- <p>
- For an example, see <link id="TDosStream.Truncate"/>.
- </p>
- </descr>
- <errors>
- Errors can be those of <link id="TBufStream.Flush">Flush</link> or
- <link id="TDosStream.Truncate"/>.
- </errors>
- <seealso>
- <link id="TStream.Truncate"/>
- <link id="TDosStream.Truncate"/>
- <link id="TStream.GetSize"/>
- </seealso>
- </element>
- <element name="TBufStream.Seek">
- <short>Set current position in file.</short>
- <descr>
- <p>
- If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the
- file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
- the beginning of the file.
- </p>
- <p>
- For an example, see <link id="TStream.Seek"/>;
- </p>
- </descr>
- <errors>
- In case an error occurs, the stream's status is set to <var>stSeekError</var>,
- and the OS error code is stored in <var>ErrorInfo</var>.
- </errors>
- <seealso>
- <link id="TStream.Seek"/>
- <link id="TStream.GetPos"/>
- </seealso>
- </element>
- <element name="TBufStream.Open">
- <short>Open the file if it is closed.</short>
- <descr>
- <p>
- If the stream's status is <var>stOK</var>, and the stream is closed then
- <var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
- This call can be used after a <link id="TBufStream.Close">Close</link> call.
- </p>
- <p>
- For an example, see <link id="TDosStream.Open"/>.
- </p>
- </descr>
- <errors>
- If an error occurs when re-opening the file, then <var>Status</var> is set
- to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
- </errors>
- <seealso>
- <link id="TStream.Open"/>
- <link id="TBufStream.Close"/>
- </seealso>
- </element>
- <element name="TBufStream.Read">
- <short>Read data from the file to a buffer in memory.</short>
- <descr>
- <p>
- If the Stream is open and the stream status is <var>stOK</var> then
- <var>Read</var> will read <var>Count</var> bytes from the stream and place them
- in <var>Buf</var>.
- </p>
- <p>
- <var>Read</var> will first try to read the data from the stream's internal
- buffer. If insufficient data is available, the buffer will be filled before
- contiunuing to read. This process is repeated until all needed data
- has been read.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
- <var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
- made to read beyond the end of the stream.
- </errors>
- <seealso>
- <link id="TStream.Read"/>
- <link id="TBufStream.Write"/>
- </seealso>
- </element>
- <element name="TBufStream.Write">
- <short>Write data to the file from a buffer in memory.</short>
- <descr>
- <p>
- If the Stream is open and the stream status is <var>stOK</var> then
- <var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
- in the stream.
- </p>
- <p>
- <var>Write</var> will first try to write the data to the stream's internal
- buffer. When the internal buffer is full, then the contents will be written
- to disk. This process is repeated until all data has been written.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
- <var>ErrorInfo</var> gets the OS specific error.
- </errors>
- <seealso>
- <link id="TStream.Write"/>
- <link id="TBufStream.Read"/>
- </seealso>
- </element>
- <element name="TMemoryStream">
- <short>Stream which keeps data in memory.</short>
- <descr>
- <p>
- The <var>TMemoryStream</var> object implements a stream that stores it's data
- in memory. The data is stored on the heap, with the possibility to specify
- the maximum amout of data, and the the size of the memory blocks being used.
- </p>
- </descr>
- <seealso>
- <link id="TStream"/>
- </seealso>
- </element>
- <element name="TMemoryStream.BlkCount">
- <short>Number of allocated memory blocks</short>
- </element>
- <element name="TMemoryStream.BlkSize">
- <short>Size of one memory block</short>
- </element>
- <element name="TMemoryStream.MemSize">
- <short>Total memory size</short>
- </element>
- <element name="TMemoryStream.BlkList">
- <short>Pointer to list of allocated blocks.</short>
- </element>
- <element name="TMemoryStream.Init">
- <short>Initialize memory stream, reserves memory for stream data.</short>
- <descr>
- <p>
- <var>Init</var> instantiates a new <var>TMemoryStream</var> object. The
- memorystreamobject will initially allocate at least <var>ALimit</var> bytes memory,
- divided into memory blocks of size <var>ABlockSize</var>.
- The number of blocks needed to get to <var>ALimit</var> bytes is rounded up.
- </p>
- <p>
- By default, the number of blocks is 1, and the size of a block is 8192. This
- is selected if you specify 0 as the blocksize.
- </p>
- <p>
- For an example, see e.g <link id="TStream.CopyFrom"/>.
- </p>
- </descr>
- <errors>
- If the stream cannot allocate the initial memory needed for the memory blocks, then
- the stream's status is set to <var>stInitError</var>.
- </errors>
- <seealso>
- <link id="TMemoryStream.Done"/>
- </seealso>
- </element>
- <element name="TMemoryStream.Done">
- <short>Clean up memory and destroy the object instance.</short>
- <descr>
- <p>
- <var>Done</var> releases the memory blocks used by the stream, and then cleans up
- the memory used by the stream object itself.
- </p>
- <p>
- For an example, see e.g <link id="TStream.CopyFrom"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TMemoryStream.Init"/>
- </seealso>
- </element>
- <element name="TMemoryStream.Truncate">
- <short>Set the stream size to the current position.</short>
- <descr>
- <var>Truncate</var> sets the size of the memory stream equal to the current
- position. It de-allocates any memory-blocks that are no longer needed, so
- that the new size of the stream is the current position in the stream,
- rounded up to the first multiple of the stream blocksize.
- </descr>
- <errors>
- If an error occurs during memory de-allocation, the stream's status is set
- to <var>stError</var>
- </errors>
- <seealso>
- <link id="TStream.Truncate"/>
- </seealso>
- <example file="objectex/ex20"/>
- </element>
- <element name="TMemoryStream.Read">
- <short>Read data from the stream to a location in memory.</short>
- <descr>
- <p>
- <var>Read</var> reads <var>Count</var> bytes from the stream to <var>Buf</var>. It updates
- the position of the stream.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- If there is not enough data available, no data is read, and the stream's
- status is set to <var>stReadError</var>.
- </errors>
- <seealso>
- <link id="TStream.Read"/>
- <link id="TMemoryStream.Write"/>
- </seealso>
- </element>
- <element name="TMemoryStream.Write">
- <short>Write data to the stream.</short>
- <descr>
- <p>
- <var>Write</var> copies <var>Count</var> bytes from <var>Buf</var> to the stream. It
- updates the position of the stream.
- </p>
- <p>
- If not enough memory is available to hold the extra <var>Count</var> bytes,
- then the stream will try to expand, by allocating as much blocks with
- size <var>BlkSize</var> (as specified in the constuctor call
- <link id="TMemoryStream.Init">Init</link>) as needed.
- </p>
- <p>
- For an example, see <link id="TStream.Read"/>.
- </p>
- </descr>
- <errors>
- If the stream cannot allocate more memory, then the status is set to
- <var>stWriteError</var>
- </errors>
- <seealso>
- <link id="TStream.Write"/>
- <link id="TMemoryStream.Read"/>
- </seealso>
- </element>
- <element name="TCollection">
- <short>Manage a collection of pointers of objects</short>
- <descr>
- <p>
- The <var>TCollection</var> object manages a collection of pointers or objects.
- It also provides a series of methods to manipulate these pointers or
- objects.
- </p>
- <p>
- Whether or not objects are used depends on the kind of calls you use.
- All kinds come in 2 flavors, one for objects, one for pointers.
- </p>
- </descr>
- </element>
- <element name="TCollection.Items">
- <short>Pointer to list of items.</short>
- </element>
- <element name="TCollection.Count">
- <short>Current count of items</short>
- </element>
- <element name="TCollection.Limit">
- <short>Max number of items</short>
- </element>
- <element name="TCollection.Delta">
- <short>Number of pointers to allocate when adding items.</short>
- </element>
- <element name="TCollection.Init">
- <short>Instantiate a new collection.</short>
- <descr>
- <p>
- <var>Init</var> initializes a new instance of a collection. It sets the (initial) maximum number
- of items in the collection to <var>ALimit</var>. <var>ADelta</var> is the increase
- size : The number of memory places that will be allocatiod in case <var>ALimit</var> is reached,
- and another element is added to the collection.
- </p>
- <p>
- For an example, see <link id="TCollection.ForEach"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.Load"/>
- <link id="TCollection.Done"/>
- </seealso>
- </element>
- <element name="TCollection.Load">
- <short>Initialize a new collection and load collection from a stream.</short>
- <descr>
- <var>Load</var> initializes a new instance of a collection. It reads from stream
- <var>S</var> the item count, the item limit count, and the increase size. After
- that, it reads the specified number of items from the stream.
- <!-- Do not call this method if you intend to use only pointers in your collection. -->
- </descr>
- <errors>
- Errors returned can be those of <link id="TCollection.GetItem">GetItem</link>.
- </errors>
- <seealso>
- <link id="TCollection.Init"/>
- <link id="TCollection.GetItem"/>
- <link id="TCollection.Done"/>
- </seealso>
- <example file="objectex/ex22"/>
- </element>
- <element name="TCollection.Done">
- <short>Clean up collection, release all memory.</short>
- <descr>
- <p>
- <var>Done</var> frees all objects in the collection, and then releases all memory
- occupied by the instance.
- </p>
- <p>
- For an example, see <link id="TCollection.ForEach"/>.
- </p>
- <!-- Do not call this method if you intend to use only pointers in your collection. -->
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.Init"/>
- <link id="TCollection.FreeAll"/>
- </seealso>
- </element>
- <element name="TCollection.At">
- <short>Return the item at a certain index.</short>
- <descr>
- <var>At</var> returns the item at position <var>Index</var>.
- </descr>
- <errors>
- If <var>Index</var> is less than zero or larger than the number of items
- in the collection, seepl{Error}{TCollection.Error} is called with
- <var>coIndexError</var> and <var>Index</var> as arguments, resulting in a run-time
- error.
- </errors>
- <seealso>
- <link id="TCollection.Insert"/>
- </seealso>
- <example file="objectex/ex23"/>
- </element>
- <element name="TCollection.IndexOf">
- <short>Find the position of a certain item.</short>
- <descr>
- <var>IndexOf</var> returns the index of <var>Item</var> in the collection.
- If <var>Item</var> isn't present in the collection, -1 is returned.
- </descr>
- <errors>
- If the item is not present, -1 is returned.
- </errors>
- <seealso>
- <link id="TCollection.At"/>
- <link id="TCollection.GetItem"/>
- <link id="TCollection.Insert"/>
- </seealso>
- <example file="objectex/ex24"/>
- </element>
- <element name="TCollection.GetItem">
- <short>Read one item off the stream.</short>
- <descr>
- <var>GetItem</var> reads a single item off the stream <var>S</var>, and
- returns a pointer to this item. This method is used internally by the Load
- method, and should not be used directly.
- </descr>
- <errors>
- Possible errors are the ones from <link id="TStream.Get"/>.
- </errors>
- <seealso>
- <link id="TStream.Get"/>,
- <link id="TCollection.Store"/>
- </seealso>
- </element>
- <element name="TCollection.LastThat">
- <short>Return last item which matches a test.</short>
- <descr>
- This function returns the last item in the collection for which <var>Test</var>
- returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
- a pointer to an object, and that returns a pointer as a result.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FirstThat"/>
- </seealso>
- <example file="objectex/ex25"/>
- </element>
- <element name="TCollection.FirstThat">
- <short>Return first item which matches a test.</short>
- <descr>
- This function returns the first item in the collection for which <var>Test</var>
- returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
- a pointer to an object, and that returns a pointer as a result.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.LastThat"/>
- </seealso>
- <example file="objectex/ex26"/>
- </element>
- <element name="TCollection.Pack">
- <short>Remove all <var>>Nil</var> pointers from the collection.</short>
- <descr>
- <var>Pack</var> removes all <var>Nil</var> pointers from the collection, and adjusts
- <var>Count</var> to reflect this change. No memory is freed as a result of this
- call. In order to free any memory, you can call <var>SetLimit</var> with an
- argument of <var>Count</var> after a call to <var>Pack</var>.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.SetLimit"/>
- </seealso>
- <example file="objectex/ex26"/>
- </element>
- <element name="TCollection.FreeAll">
- <short>Release all objects from the collection.</short>
- <descr>
- <var>FreeAll</var> calls the destructor of each object in the collection.
- It doesn't release any memory occumpied by the collection itself, but it
- does set <var>Count</var> to zero.
- </descr>
- <errors>
- </errors>
- <seealso>
- <link id="TCollection.DeleteAll"/>
- <link id="TCollection.FreeItem"/>
- </seealso>
- <example file="objectex/ex28"/>
- </element>
- <element name="TCollection.DeleteAll">
- <short>Delete all elements from the collection. Objects are not destroyed.</short>
- <descr>
- <var>DeleteAll</var> deletes all elements from the collection. It just sets
- the <var>Count</var> variable to zero. Contrary to
- <link id="TCollection.FreeAll">FreeAll</link>, <var>DeletAll</var> doesn't call the
- destructor of the objects.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FreeAll"/>
- <link id="TCollection.Delete"/>
- </seealso>
- <example file="objectex/ex29"/>
- </element>
- <element name="TCollection.Free">
- <short>Free item from collection, calling it's destructor.</short>
- <descr>
- <var>Free</var> Deletes <var>Item</var> from the collection, and calls the destructor
- <var>Done</var> of the object.
- </descr>
- <errors>
- If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
- <var>coIndexError</var>.
- </errors>
- <seealso>
- <link id="TCollection.FreeItem"/>
- </seealso>
- <example file="objectex/ex30"/>
- </element>
- <element name="TCollection.Insert">
- <short>Insert a new item in the collection at the end.</short>
- <descr>
- <var>Insert</var> inserts <var>Item</var> in the collection. <var>TCollection</var>
- inserts this item at the end, but descendent objects may insert it at
- another place.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.AtInsert"/>
- <link id="TCollection.AtPut"/>
- </seealso>
- </element>
- <element name="TCollection.Delete">
- <short>Delete an item from the collection, but does not destroy it.</short>
- <descr>
- <var>Delete</var> deletes <var>Item</var> from the collection. It doesn't call the
- item's destructor, though. For this the <link id="TCollection.Free">Free</link>
- call is provided.
- </descr>
- <errors>
- If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
- <var>coIndexError</var>.
- </errors>
- <seealso>
- <link id="TCollection.AtDelete"/>
- <link id="TCollection.Free"/>
- </seealso>
- <example file="objectex/ex31"/>
- </element>
- <element name="TCollection.AtFree">
- <short>Free an item at the indicates position, calling it's destructor.</short>
- <descr>
- <var>AtFree</var> deletes the item at position <var>Index</var> in the collection,
- and calls the item's destructor if it is not <var>Nil</var>.
- </descr>
- <errors>
- If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
- with <var>CoIndexError</var>.
- </errors>
- <seealso>
- <link id="TCollection.Free"/>
- <link id="TCollection.AtDelete"/>
- </seealso>
- <example file="objectex/ex32"/>
- </element>
- <element name="TCollection.FreeItem">
- <short>Destroy a non-nil item.</short>
- <descr>
- <p>
- <var>FreeItem</var> calls the destructor of <var>Item</var> if it is not
- nil.
- </p>
- <remark>
- This function is used internally by the TCollection object, and should not be
- called directly.
- </remark>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.Free"/>
- <link id="TCollection.AtFree"/>
- </seealso>
- </element>
- <element name="TCollection.AtDelete">
- <short>Delete item at certain position.</short>
- <descr>
- <var>AtDelete</var> deletes the pointer at position <var>Index</var> in the
- collection. It doesn't call the object's destructor.
- </descr>
- <errors>
- If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
- with <var>CoIndexError</var>.
- </errors>
- <seealso>
- <link id="TCollection.Delete"/>
- </seealso>
- <example file="objectex/ex33"/>
- </element>
- <element name="TCollection.ForEach">
- <short>Execute procedure for each item in the list.</short>
- <descr>
- <p>
- <var>ForEach</var> calls <var>Action</var> for each element in the collection,
- and passes the element as an argument to <var>Action</var>.
- </p>
- <p>
- <var>Action</var> is a procedural type variable that accepts a pointer as an
- argument.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FirstThat"/>
- <link id="TCollection.LastThat"/>
- </seealso>
- <example file="objectex/ex21"/>
- </element>
- <element name="TCollection.SetLimit">
- <short>Set maximum number of elements in the collection.</short>
- <descr>
- <p>
- <var>SetLimit</var> sets the maximum number of elements in the collection.
- <var>ALimit</var> must not be less than <var>Count</var>, and should not be larger
- than <var>MaxCollectionSize</var>
- </p>
- <p>
- For an example, see <link id="TCollection.Pack">Pack</link>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.Init"/>
- </seealso>
- </element>
- <element name="TCollection.Error">
- <short>Set error code.</short>
- <descr>
- <p>
- <var>Error</var> is called by the various <var>TCollection</var> methods
- in case of an error condition. The default behaviour is to make
- a call to <var>RunError</var> with an error of <var>212-Code</var>.
- </p>
- <p>
- This method can be overridden by descendent objects to implement
- a different error-handling.
- </p>
- </descr>
- <errors>
- </errors>
- <seealso>
- <link id="Abstract"/>
- </seealso>
- </element>
- <element name="TCollection.AtPut">
- <short>Set collection item, overwriting an existing value.</short>
- <descr>
- <p>
- <var>AtPut</var> sets the element at position <var>Index</var> in the collection
- to <var>Item</var>. Any previous value is overwritten.
- </p>
- <p>
- For an example, see <link id="TCollection.Pack">Pack</link>.
- </p>
- </descr>
- <errors>
- If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
- with <var>CoIndexError</var>.
- </errors>
- <seealso>
- </seealso>
- </element>
- <element name="TCollection.AtInsert">
- <short>Insert an element at a certain position in the collection.</short>
- <descr>
- <var>AtInsert</var> inserts <var>Item</var> in the collection at position <var>Index</var>,
- shifting all elements by one position. In case the current limit is reached,
- the collection will try to expand with a call to <var>SetLimit</var>
- </descr>
- <errors>
- If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
- with <var>CoIndexError</var>. If the collection fails to expand, then
- <var>coOverFlow</var> is passd to <var>Error</var>.
- </errors>
- <seealso>
- <link id="TCollection.Insert"/>
- </seealso>
- <example file="objectex/ex34"/>
- </element>
- <element name="TCollection.Store">
- <short>Write collection to a stream.</short>
- <descr>
- <p>
- <var>Store</var> writes the collection to the stream <var>S</var>. It does
- this by writeing the current <var>Count</var>, <var>Limit</var> and <var>Delta</var>
- to the stream, and then writing each item to the stream.
- </p>
- <p>
- The contents of the stream are then suitable for instantiating another
- collection with <link id="TCollection.Load">Load</link>.
- </p>
- <p>
- For an example, see <link id="TCollection.Load"/>.
- </p>
- </descr>
- <errors>
- Errors returned are those by <link id="TStream.Put"/>.
- </errors>
- <seealso>
- <link id="TCollection.Load"/>
- <link id="TCollection.PutItem"/>
- </seealso>
- </element>
- <element name="TCollection.PutItem">
- <short>Put one item on the stream</short>
- <descr>
- <var>PutItem</var> writes <var>Item</var> to stream <var>S</var>. This method is used
- internaly by the <var>TCollection</var> object, and should not be called
- directly.
- </descr>
- <errors>
- Errors are those returned by <link id="TStream.Put"/>.
- </errors>
- <seealso>
- <link id="TCollection.Store">Store</link>
- <link id="TCollection.GetItem">GetItem</link>
- </seealso>
- </element>
- <element name="TSortedCollection">
- <short>Abstract sorted collection.</short>
- <descr>
- <p>
- <var>TSortedCollection</var> is an abstract class, implementing a sorted
- collection. You should never use an instance of <var>TSortedCollection</var>
- directly, instead you should declare a descendent type, and override the
- <link id="TSortedCollection.Compare">Compare</link> method.
- </p>
- <p>
- Because the collection is ordered, <var>TSortedCollection</var> overrides some
- <var>TCollection</var> methods, to provide faster routines for lookup.
- </p>
- <p>
- The <link id="TSortedCollection.Compare">Compare</link> method decides how elements
- in the collection should be ordered. Since <var>TCollection</var> has no way
- of knowing how to order pointers, you must override the compare method.
- </p>
- <p>
- Additionally, <var>TCollection</var> provides a means to filter out duplicates.
- if you set <var>Duplicates</var> to <var>False</var> (the default) then duplicates
- will not be allowed.
- </p>
- <p>
- The example below defines a descendent of <var>TSortedCollection</var> which
- is used in the examples.
- </p>
- </descr>
- <example file="objectex/mysortc"/>
- </element>
- <element name="TSortedCollection.Duplicates">
- <short>If <var>True</var> duplicate strings are allowed in the collection.</short>
- </element>
- <element name="TSortedCollection.Init">
- <short>Instantiates a new instance of a <var>TSortedCollection</var></short>
- <descr>
- <p>
- <var>Init</var> calls the inherited constuctor (see <link id="TCollection.Init"/>) and
- sets the <var>Duplicates</var> flag to false.
- </p>
- <p>
- You should not call this method directly, since <var>TSortedCollection</var> is a
- abstract class. Instead, the descendent classes should call it via the
- <var>inherited</var> keyword.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.Load"/>
- <link id="TCollection.Done"/>
- </seealso>
- </element>
- <element name="TSortedCollection.Load">
- <short>Instantiates a new instance of a <var>TSortedCollection</var> and
- loads it from stream.</short>
- <descr>
- <p>
- <var>Load</var> calls the inherited constuctor (see <link id="TCollection.Load"/>) and
- reads the <var>Duplicates</var> flag from the stream..
- </p>
- <p>
- You should not call this method directly, since <var>TSortedCollection</var> is a
- abstract class. Instead, the descendent classes should call it via the
- <var>inherited</var> keyword.
- </p>
- <p>
- For an example, see <link id="TCollection.Load"/>.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.Init"/>
- <link id="TCollection.Done"/>
- </seealso>
- </element>
- <element name="TSortedCollection.KeyOf">
- <short>Return the key of an item</short>
- <descr>
- <p>
- <var>KeyOf</var> returns the key associated with <var>Item</var>.
- <var>TSortedCollection</var> returns the item itself as the key, descendent
- objects can override this method to calculate a (unique) key based on the
- item passed (such as hash values).
- </p>
- <p>
- <var>Keys</var> are used to sort the objects, they are used to search and sort
- the items in the collection. If descendent types override this method then
- it allows possibly for faster search/sort methods based on keys rather than
- on the objects themselves.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.IndexOf"/>
- <link id="TSortedCollection.Compare"/>
- </seealso>
- </element>
- <element name="TSortedCollection.IndexOf">
- <short>Return index of an item in the collection.</short>
- <descr>
- <p>
- <var>IndexOf</var> returns the index of <var>Item</var> in the collection. It searches
- for the object based on it's key. If duplicates are allowed, then it returns
- the index of last object that matches <var>Item</var>.
- </p>
- <p>
- In case <var>Item</var> is not found in the collection, -1 is returned.
- </p>
- <p>
- For an example, see <link id="TCollection.IndexOf"/>
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.Search"/>
- <link id="TSortedCollection.Compare"/>
- </seealso>
- </element>
- <element name="TSortedCollection.Compare">
- <short>Compare two items in the collection.</short>
- <descr>
- <p>
- <var>Compare</var> is an abstract method that should be overridden by descendent
- objects in order to compare two items in the collection. This method is used
- in the <link id="TSortedCollection.Search">Search</link> method and in the
- <link id="TSortedCollection.Insert">Insert</link> method to determine the ordering of
- the objects.
- </p>
- <p>
- The function should compare the two keys of items and return the following
- function results:
- </p>
- <dl>
- <dt>Result < 0</dt><dd>If <var>Key1</var> is logically before <var>Key2</var> (<var>Key1<Key2</var>)</dd>
- <dt>Result = 0</dt><dd> If <var>Key1</var> and <var>Key2</var> are equal. (<var>Key1=Key2</var>)</dd>
- <dt>Result > 0</dt><dd> If <var>Key1</var> is logically after <var>Key2</var> (<var>Key1>Key2</var>)</dd>
- </dl>
- </descr>
- <errors>
- An 'abstract run-time error' will be generated if you call
- <var>TSortedCollection.Compare</var> directly.
- </errors>
- <seealso>
- <link id="TSortedCollection.IndexOf"/>
- <link id="TSortedCollection.Search"/>
- </seealso>
- <example file="objectex/mysortc"/>
- </element>
- <element name="TSortedCollection.Search">
- <short>Search for item with given key.</short>
- <descr>
- <p>
- <var>Search</var> looks for the item with key <var>Key</var> and returns the position
- of the item (if present) in the collection in <var>Index</var>.
- </p>
- <p>
- Instead of a linear search as <var>TCollection</var> does, <var>TSortedCollection</var>
- uses a binary search based on the keys of the objects. It uses the
- <link id="TSortedCollection.Compare">Compare</link> function to implement this
- search.
- </p>
- <p>
- If the item is found, <var>Search</var> returns <var>True</var>, otherwise <var>False</var>
- is returned.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.IndexOf"/>
- </seealso>
- <example file="objectex/ex36"/>
- </element>
- <element name="TSortedCollection.Insert">
- <short>Insert new item in collection.</short>
- <descr>
- <p>
- <var>Insert</var> inserts an item in the collection at the correct position, such
- that the collection is ordered at all times. You should never use
- <link id="TCollection.AtInsert">Atinsert</link>, since then the collection ordering
- is not guaranteed.
- </p>
- <p>
- If <var>Item</var> is already present in the collection, and <var>Duplicates</var> is
- <var>False</var>, the item will not be inserted.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.AtInsert"/>
- </seealso>
- <example file="objectex/ex35"/>
- </element>
- <element name="TSortedCollection.Store">
- <short>Write the collection to the stream.</short>
- <descr>
- <p>
- <var>Store</var> writes the collection to the stream <var>S</var>. It does this by
- calling the inherited <link id="TCollection.Store"/>, and then writing the
- <var>Duplicates</var> flag to the stream.
- </p>
- <p>
- After a <var>Store</var>, the collection can be loaded from the stream with the
- constructor <link id="TSortedCollection.Load">Load</link>
- </p>
- <p>
- For an example, see <link id="TCollection.Load"/>.
- </p>
- </descr>
- <errors>
- Errors can be those of <link id="TStream.Put"/>.
- </errors>
- <seealso>
- <link id="TSortedCollection.Load"/>
- </seealso>
- </element>
- <element name="TStringCollection">
- <short>Collection of pascal strings.</short>
- <descr>
- <p>
- The <var>TStringCollection</var> object manages a sorted collection of pascal
- strings.
- To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
- method of <var>TSortedCollection</var>, and it introduces methods to read/write
- strings from a stream.
- </p>
- </descr>
- </element>
- <element name="TStringCollection.GetItem">
- <short>Get string from the stream.</short>
- <descr>
- <p>
- <var>GetItem</var> reads a string from the stream <var>S</var> and returns a pointer
- to it. It doesn't insert the string in the collection.
- </p>
- <p>
- This method is primarily introduced to be able to load and store the
- collection from and to a stream.
- </p>
- </descr>
- <errors>
- The errors returned are those of <link id="TStream.ReadStr"/>.
- </errors>
- <seealso>
- <link id="TStringCollection.PutItem"/>
- </seealso>
- </element>
- <element name="TStringCollection.Compare">
- <short>Compare two strings in the collection.</short>
- <descr>
- <p>
- <var>TStringCollection</var> overrides the <var>Compare</var> function so it compares
- the two keys as if they were pointers to strings. The compare is done case
- sensitive. It returns the following results:
- </p>
- <dl>
- <dt>-1</dt><dd> if the first string is alphabetically earlier than the second string.</dd>
- <dt>0</dt><dd> if the two strings are equal.</dd>
- <dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
- </dl>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.Compare"/>
- </seealso>
- <example file="objectex/ex37"/>
- </element>
- <element name="TStringCollection.FreeItem">
- <short>Dispose a string in the collection from memory.</short>
- <descr>
- <var>TStringCollection</var> overrides <var>FreeItem</var> so that the string pointed
- to by <var>Item</var> is disposed from memory.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FreeItem"/>
- </seealso>
- </element>
- <element name="TStringCollection.PutItem">
- <short>Write a string to the stream.</short>
- <descr>
- <p>
- <var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
- <var>S</var>.
- </p>
- <p>
- This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
- and should not be used directly.
- </p>
- </descr>
- <errors>
- Errors are those of <link id="TStream.WriteStr"/>.
- </errors>
- <seealso>
- <link id="TStringCollection.GetItem"/>
- </seealso>
- </element>
- <element name="TStrCollection">
- <short>Collection of null-terminated strings</short>
- <descr>
- <p>
- The <var>TStrCollection</var> object manages a sorted collection
- of null-terminated strings (pchar strings).
- To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
- method of <var>TSortedCollection</var>, and it introduces methods to read/write
- strings from a stream.
- </p>
- </descr>
- </element>
- <element name="TStrCollection.GetItem">
- <short>Read a null-terminated string from the stream.</short>
- <descr>
- <p>
- <var>GetItem</var> reads a null-terminated string from the stream <var>S</var>
- and returns a pointer to it. It doesn't insert the string in the
- collection.
- </p>
- <p>
- This method is primarily introduced to be able to load and store the
- collection from and to a stream.
- </p>
- </descr>
- <errors>
- The errors returned are those of <link id="TStream.StrRead"/>.
- </errors>
- <seealso>
- <link id="TStrCollection.PutItem"/>
- </seealso>
- </element>
- <element name="TStrCollection.Compare">
- <short>Compare two strings in the collection.</short>
- <descr>
- <p>
- <var>TStrCollection</var> overrides the <var>Compare</var> function so it compares
- the two keys as if they were pointers to strings. The compare is done case
- sensitive. It returns
- </p>
- <dl>
- <dt>-1</dt><dd> if the first string is alphabetically earlier than the second string. </dd>
- <dt>0</dt><dd> if the two strings are equal. </dd>
- <dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
- </dl>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TSortedCollection.Compare"/>
- </seealso>
- <example file="objectex/ex38"/>
- </element>
- <element name="TStrCollection.FreeItem">
- <short>Free null-terminated string from the collection.</short>
- <descr>
- <var>TStrCollection</var> overrides <var>FreeItem</var> so that the string pointed
- to by <var>Item</var> is disposed from memory.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FreeItem"/>
- </seealso>
- </element>
- <element name="TStrCollection.PutItem">
- <short>Write a null-terminated string to the stream.</short>
- <descr>
- <p>
- <var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
- <var>S</var>.
- </p>
- <p>
- This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
- and should not be used directly.
- </p>
- </descr>
- <errors>
- Errors are those of <link id="TStream.StrWrite"/>.
- </errors>
- <seealso>
- <link id="TStrCollection.GetItem"/>
- </seealso>
- </element>
- <element name="TUnSortedStrCollection">
- <short>Unsorted string collection</short>
- <descr>
- <p>
- The <var>TUnSortedStrCollection</var> object manages an unsorted list of strings.
- To this end, it overrides the <link id="TStringCollection.Insert"/> method to add
- strings at the end of the collection, rather than in the alphabetically
- correct position.
- </p>
- <p>
- Take care, the <link id="TSortedCollection.Search">Search</link> and
- <link id="TCollection.IndexOf">IndexOf</link> methods will not work on an unsorted
- string collection.
- </p>
- </descr>
- </element>
- <element name="TUnSortedStrCollection.Insert">
- <short>Insert a new string in the collection.</short>
- <descr>
- <var>Insert</var> inserts a string at the end of the collection, instead
- of on it's alphabetical place, resulting in an unsorted collection of
- strings.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.Insert"/>
- </seealso>
- <example file="objectex/ex39"/>
- </element>
- <element name="TResourceCollection">
- <short>Collection of resource names</short>
- <descr>
- <p>
- A <var>TResourceCollection</var> manages a collection of resource names.
- It stores the position and the size of a resource, as well as the name of
- the resource. It stores these items in records that look like this:
- </p>
- <code>
- TYPE
- TResourceItem = packed RECORD
- Posn: LongInt;
- Size: LongInt;
- Key : String;
- End;
- PResourceItem = ^TResourceItem;
- </code>
- <p>
- It overrides some methods of <var>TStringCollection</var> in order to accomplish
- this.
- </p>
- <remark>
- Remark that the <var>TResourceCollection</var> manages the names of the
- resources and their assiciated positions and sizes, it doesn't manage
- the resources themselves.
- </remark>
- </descr>
- </element>
- <element name="TResourceCollection.KeyOf">
- <short>Return the key of an item in the collection.</short>
- <descr>
- <var>KeyOf</var> returns the key of an item in the collection. For resources, the
- key is a pointer to the string with the resource name.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStringCollection.Compare"/>
- </seealso>
- </element>
- <element name="TResourceCollection.GetItem">
- <short>Read an item from the stream.</short>
- <descr>
- <p>
- <var>GetItem</var> reads a resource item from the stream <var>S</var>. It reads the
- position, size and name from the stream, in that order. It DOES NOT read the
- resource itself from the stream.
- </p>
- <p>
- The resulting item is not inserted in the collection. This call is manly for
- internal use by the <link id="TCollection.Load"/> method.
- </p>
- </descr>
- <errors>
- Errors returned are those by <link id="TStream.Read"/>
- </errors>
- <seealso>
- <link id="TCollection.Load"/>
- <link id="TStream.Read"/>
- </seealso>
- </element>
- <element name="TResourceCollection.FreeItem">
- <short>Release memory occupied by item.</short>
- <descr>
- <p>
- <var>FreeItem</var> releases the memory occupied by <var>Item</var>. It de-allocates
- the name, and then the resourceitem record.
- </p>
- <p>
- It does NOT remove the item from the collection.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TCollection.FreeItem"/>
- </seealso>
- </element>
- <element name="TResourceCollection.PutItem">
- <short>Write an item to the stream.</short>
- <descr>
- <p>
- <var>PutItem</var> writes <var>Item</var> to the stream <var>S</var>. It does this by
- writing the position and size and name of the resource item to the stream.
- </p>
- <p>
- This method is used primarily by the <link id="TCollection.Store">Store</link>
- method.
- </p>
- </descr>
- <errors>
- Errors returned are those by <link id="TStream.Write"/>.
- </errors>
- <seealso>
- <link id="TCollection.Store"/>
- </seealso>
- </element>
- <element name="TResourceFile">
- <short>Resource file</short>
- <descr>
- <link id="TResourceFile"/> represents the resources in a binary file image.
- </descr>
- </element>
- <element name="TResourceFile.Stream">
- <short>Actual file stream</short>
- <descr>
- contains the (file) stream that has the executable image and
- the resources. It can be initialized by the <link id="TResourceFile.Init">Init</link>
- constructor call.
- </descr>
- </element>
- <element name="TResourceFile.Modified">
- <short>Have resources changed ?</short>
- <descr>
- <var>Modified</var> is set to <var>True</var> if one of the resources has been changed.
- It is set by the <link id="TResourceFile.Init">SwitchTo</link>,
- <link id="TResourceFile.Delete">Delete</link> and <link id="TResourceFile.Put">Put</link>
- methods. Calling <link id="TResourceFile.Flush">Flush</link> will clear the
- <var>Modified</var> flag.
- </descr>
- </element>
- <element name="TResourceFile.Init">
- <short>Instantiate a new instance.</short>
- <descr>
- <p>
- <var>Init</var> instantiates a new instance of a <var>TResourceFile</var> object.
- If <var>AStream</var> is not nil then it is considered as a stream describing an
- executable image on disk.
- </p>
- <p>
- <var>Init</var> will try to position the stream on the start of the resources section,
- and read all resources from the stream.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TResourceFile.Done"/>
- </seealso>
- </element>
- <element name="TResourceFile.Done">
- <short>Destroy the instance and remove it from memory.</short>
- <descr>
- <var>Done</var> cleans up the instance of the <var>TResourceFile</var> Object.
- If <var>Stream</var> was specified at initialization, then <var>Stream</var> is
- disposed of too.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TResourceFile.Init"/>
- </seealso>
- </element>
- <element name="TResourceFile.Count">
- <short>Number of resources in the file</short>
- <descr>
- <var>Count</var> returns the number of resources. If no resources were
- read, zero is returned.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TResourceFile.Init"/>
- </seealso>
- </element>
- <element name="TResourceFile.KeyAt">
- <short>Return the key of the item at a certain position.</short>
- <descr>
- <var>KeyAt</var> returns the key (the name) of the <var>I</var>-th resource.
- </descr>
- <errors>
- In case <var>I</var> is invalid, <var>TCollection.Error</var> will be executed.
- </errors>
- <seealso>
- <link id="TResourceFile.Get"/>
- </seealso>
- </element>
- <element name="TResourceFile.Get">
- <short>Return a resource by key name.</short>
- <descr>
- <var>Get</var> returns a pointer to a instance of a resource identified by
- <var>Key</var>. If <var>Key</var> cannot be found in the list of resources, then
- <var>Nil</var> is returned.
- </descr>
- <errors>
- Errors returned may be those by <var>TStream.Get</var>
- </errors>
- <seealso>
- </seealso>
- </element>
- <element name="TResourceFile.SwitchTo">
- <short>Write resources to a new stream.</short>
- <descr>
- <p>
- <var>SwitchTo</var> switches to a new stream to hold the resources in.
- <var>AStream</var> will be the new stream after the call to <var>SwitchTo</var>.
- </p>
- <p>
- If <var>Pack</var> is true, then all the known resources will be copied from
- the current stream to the new stream (<var>AStream</var>). If <var>Pack</var> is
- <var>False</var>, then only the current resource is copied.
- </p>
- <p>
- The return value is the value of the original stream: <var>Stream</var>.
- </p>
- <p>
- The <var>Modified</var> flag is set as a consequence of this call.
- </p>
- </descr>
- <errors>
- Errors returned can be those of <link id="TStream.Read"/> and
- <link id="TStream.Write"/>.
- </errors>
- <seealso>
- <link id="TResourceFile.Flush"/>
- </seealso>
- </element>
- <element name="TResourceFile.Flush">
- <short>Writes the resources to the stream.</short>
- <descr>
- If the <var>Modified</var> flag is set to <var>True</var>, then <var>Flush</var>
- writes the resources to the stream <var>Stream</var>. It sets the <var>Modified</var>
- flag to true after that.
- </descr>
- <errors>
- Errors can be those by <link id="TStream.Seek"/> and <link id="TStream.Write"/>.
- </errors>
- <seealso>
- <link id="TResourceFile.SwitchTo"/>
- </seealso>
- </element>
- <element name="TResourceFile.Delete">
- <short>Delete a resource from the file</short>
- <descr>
- <var>Delete</var> deletes the resource identified by <var>Key</var> from the
- collection. It sets the <var>Modified</var> flag to true.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TResourceFile.Flush"/>
- </seealso>
- </element>
- <element name="TResourceFile.Put">
- <short>Set a resource by key name.</short>
- <descr>
- <var>Put</var> sets the resource identified by <var>Key</var> to <var>Item</var>.
- If no such resource exists, a new one is created. The item is written
- to the stream.
- </descr>
- <errors>
- Errors returned may be those by <link id="TStream.Put"/> and <var>TStream.Seek</var>
- </errors>
- <seealso>
- <link id="TResourceFile.Get">Get</link>
- </seealso>
- </element>
- <element name="TStringList">
- <short>Collection of strings</short>
- <descr>
- <p>
- A <var>TStringList</var> object can be used to read a collection of strings
- stored in a stream. If you register this object with the <link id="RegisterType"/>
- function, you cannot register the <var>TStrListMaker</var> object.
- </p>
- </descr>
- </element>
- <element name="TStringList.Load">
- <short>Load stringlist from stream.</short>
- <descr>
- The <var>Load</var> constructor reads the <var>TStringList</var> object from the
- stream <var>S</var>. It also reads the descriptions of the strings from the
- stream. The string descriptions are stored as an array of
- <var>TstrIndexrec</var> records, where each record describes a string on the
- stream. These records are kept in memory.
- </descr>
- <errors>
- If an error occurs, a stream error is triggered.
- </errors>
- <seealso>
- <link id="TStringList.Done"/>
- </seealso>
- </element>
- <element name="TStringList.Done">
- <short>Clean up the instance</short>
- <descr>
- The <var>Done</var> destructor frees the memory occupied by the string
- descriptions, and destroys the object.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStringList.Load">Load</link>
- <link id="TObject.Done"/>
- </seealso>
- </element>
- <element name="TStringList.Get">
- <short>Return a string by key name</short>
- <descr>
- <var>Get</var> reads the string with key <var>Key</var> from the list of strings on the
- stream, and returns this string. If there is no string with such a key, an
- empty string is returned.
- </descr>
- <errors>
- If no string with key <var>Key</var> is found, an empty string is returned.
- A stream error may result if the stream doesn't contain the needed strings.
- </errors>
- <seealso>
- <link id="TStrListMaker.Put"/>
- </seealso>
- </element>
- <element name="TStrListMaker">
- <short>Generate a stream with strings, readable by <link id="TStringList"/></short>
- <descr>
- <p>
- The <var>TStrListMaker</var> object can be used to generate a stream with
- strings, which can be read with the <var>TStringList</var> object.
- If you register this object with the <link id="RegisterType"/>
- function, you cannot register the <var>TStringList</var> object.
- </p>
- </descr>
- </element>
- <element name="TStrListMaker.Init">
- <short>Instantiate a new instance of <var>TStrListMaker</var></short>
- <descr>
- <p>
- The <var>Init</var> constructor creates a new instance of the <var>TstrListMaker</var>
- object. It allocates <var>AStrSize</var> bytes on the heap to hold all the
- strings you wish to store. It also allocates enough room for
- <var>AIndexSize</var> key description entries (of the type <var>TStrIndexrec</var>).
- </p>
- <p>
- <var>AStrSize</var> must be large enough to contain all the strings you wish to
- store. If not enough memory is allocated, other memory will be overwritten.
- The same is true for <var>AIndexSize</var> : maximally <var>AIndexSize</var> strings
- can be written to the stream.
- </p>
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TObject.Init"/>
- <link id="TStrListMaker.Done"/>
- </seealso>
- </element>
- <element name="TStrListMaker.Done">
- <short>Clean up the instance and free all related memory.</short>
- <descr>
- The <var>Done</var> destructor de-allocates the memory for the index description
- records and the string data, and then destroys the object.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TObject.Done"/>
- <link id="TStrListMaker.Init"/>
- </seealso>
- </element>
- <element name="TStrListMaker.Put">
- <short>Add a new string to the list with associated key.</short>
- <descr>
- <var>Put</var> adds they string <var>S</var> with key <var>Key</var> to the collection of
- strings. This action doesn't write the string to a stream. To write the
- strings to the stream, see the <link id="TStrListMaker.Store">Store</link> method.
- </descr>
- <errors>
- None.
- </errors>
- <seealso>
- <link id="TStrListMaker.Store"/>
- </seealso>
- </element>
- <element name="TStrListMaker.Store">
- <short>Write the strings to the stream.</short>
- <descr>
- <var>Store</var> writes the collection of strings to the stream <var>S</var>.
- The collection can then be read with the <var>TStringList</var> object.
- </descr>
- <errors>
- A stream error may occur when writing the strings to the stream.
- </errors>
- <seealso>
- <link id="TStringList.Load"/>
- <link id="TStrListMaker.Put"/>
- </seealso>
- </element>
- <element name="InvalidHandle">
- <short>Value for invalid handle. Initial value for file stream handles or when the stream is closed.</short>
- </element>
- <!-- function Visibility: default -->
- <element name="CallVoidConstructor">
- <short>Call a constructor with no arguments</short>
- <descr>
- <p>
- <var>CallVoidConstructor</var> calls the constructor of an object.
- <var>Ctor</var> is the address of the constructor, <var>Obj</var> is a
- pointer to the instance. If it is <var>Nil</var>, then a new instance is
- allocated. <var>VMT</var> is a pointer to the object's VMT. The return value
- is a pointer to the instance.
- </p>
- <p>
- Note that this can only be used on constructors that require no arguments.
- </p>
- </descr>
- <errors>
- If the constructor expects arguments, the stack may be corrupted.
- </errors>
- <seealso>
- <link id="CallPointerConstructor"/>
- <link id="CallPointerMethod"/>
- <link id="CallVoidLocal"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallPointerConstructor">
- <short>Call a constructor with a pointer argument.</short>
- <descr>
- <p>
- <var>CallVoidConstructor</var> calls the constructor of an object.
- <var>Ctor</var> is the address of the constructor, <var>Obj</var> is a
- pointer to the instance. If it is <var>Nil</var>, then a new instance is
- allocated. <var>VMT</var> is a pointer to the object's VMT.
- <var>Param1</var> is passed to the constructor. The return value
- is a pointer to the instance.
- </p>
- <p>
- Note that this can only be used on constructors that require a pointer as
- the sole argument. It can also be used to call a constructor with a single
- argument by reference.
- </p>
- </descr>
- <errors>
- If the constructor expects other arguments than a pointer, the stack may be corrupted.
- </errors>
- <seealso>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerMethod"/>
- <link id="CallVoidLocal"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallVoidMethod">
- <short>Call an object method</short>
- <descr>
- <var>CallVoidMethod</var> calls the method with address <var>Method</var>
- for instance <var>Obj</var>. It returns a pointer to the instance.
- </descr>
- <errors>
- If the method expects parameters, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallPointerMethod"/>
- <link id="CallVoidLocal"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallPointerMethod">
- <short>Call a method with a single pointer argument</short>
- <descr>
- <var>CallPointerMethod</var> calls the method with address <var>Method</var>
- for instance <var>Obj</var>. It passes <var>Param1</var> to the method as
- the single argument. It returns a pointer to the instance.
- </descr>
- <errors>
- If the method expects other parameters than a single pointer, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallVoidMethod"/>
- <link id="CallVoidLocal"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallVoidLocal">
- <short>Call a local nested procedure.</short>
- <descr>
- <var>CallVoidLocal</var> calls the local procedure with address
- <var>Func</var>, where <var>Frame</var> is the frame of the wrapping
- function.
- </descr>
- <errors>
- If the local function expects parameters, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallPointerMethod"/>
- <link id="CallVoidMethod"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallPointerLocal">
- <short>Call a local nested function with a pointer argument</short>
- <descr>
- <var>CallPointerLocal</var> calls the local procedure with address
- <var>Func</var>, where <var>Frame</var> is the frame of the wrapping
- function. It passes <var>Param1</var> to the local function.
- </descr>
- <errors>
- If the local function expects other parameters than a pointer, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallPointerMethod"/>
- <link id="CallVoidMethod"/>
- <link id="CallVoidLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallPointerMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallVoidMethodLocal">
- <short>Call a local procedure of a method</short>
- <descr>
- <var>CallVoidMethodLocal</var> calls the local procedure with address
- <var>Func</var>, where <var>Frame</var> is the frame of the wrapping
- method.
- </descr>
- <errors>
- If the local function expects parameters, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallPointerMethod"/>
- <link id="CallVoidMethod"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidLocal"/>
- <link id="CallPointerMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- function Visibility: default -->
- <element name="CallPointerMethodLocal">
- <short>Call a local procedure of a method with a pointer argument</short>
- <var>CallPointerMethodLocal</var> calls the local procedure with address
- <var>Func</var>, where <var>Frame</var> is the frame of the wrapping
- method. It passes <var>Param1</var> to the local function.
- </descr>
- <errors>
- If the local function expects other parameters than a pointer, the stack may become corrupted.
- </errors>
- <seealso>
- <link id="CallPointerMethod"/>
- <link id="CallVoidMethod"/>
- <link id="CallPointerLocal"/>
- <link id="CallVoidLocal"/>
- <link id="CallVoidMethodLocal"/>
- <link id="CallVoidConstructor"/>
- <link id="CallPointerConstructor"/>
- </seealso>
- </element>
- <!-- constant Visibility: default -->
- <element name="DefaultTPCompatible">
- <short>Default value for <link id="#rtl.objects.tstream.tpcompatible">tstream.tpcompatible</link></short>
- <descr>
- <var>DefaultTPCompatible</var> is used to initialize <link
- id="tstream.tpcompatible">tstream.tpcompatible</link>.
- </descr>
- </element>
- </module>
- </package>
- </fpdoc-descriptions>
|