Changeset 312


Ignore:
Timestamp:
Jan 9, 2012, 2:22:31 PM (12 years ago)
Author:
chronos
Message:
  • Modified: TGStream is now implemented. TMemoryStreamByte have additional methods usable for byte streams.
  • Added: Few other missing methods in TGList.
Location:
Generics/TemplateGenerics
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Demo/Demo.lpi

    r270 r312  
    3333      <Item1>
    3434        <PackageName Value="TemplateGenerics"/>
     35        <DefaultFilename Value="../TemplateGenerics.lpk" Prefer="True"/>
    3536      </Item1>
    3637      <Item2>
     
    3839      </Item2>
    3940    </RequiredPackages>
    40     <Units Count="66">
     41    <Units Count="75">
    4142      <Unit0>
    4243        <Filename Value="Demo.lpr"/>
     
    5758        <EditorIndex Value="0"/>
    5859        <WindowIndex Value="0"/>
    59         <TopLine Value="71"/>
    60         <CursorPos X="22" Y="90"/>
     60        <TopLine Value="640"/>
     61        <CursorPos X="20" Y="653"/>
    6162        <UsageCount Value="233"/>
    6263        <Bookmarks Count="1">
    63           <Item0 X="65" Y="233" ID="2"/>
     64          <Item0 X="65" Y="275" ID="2"/>
    6465        </Bookmarks>
    6566        <Loaded Value="True"/>
     
    7374        <TopLine Value="1"/>
    7475        <CursorPos X="1" Y="11"/>
    75         <UsageCount Value="4"/>
     76        <UsageCount Value="3"/>
    7677      </Unit2>
    7778      <Unit3>
    7879        <Filename Value="../Specialized/SpecializedList.pas"/>
    7980        <UnitName Value="SpecializedList"/>
    80         <EditorIndex Value="1"/>
     81        <EditorIndex Value="3"/>
    8182        <WindowIndex Value="0"/>
    8283        <TopLine Value="47"/>
    8384        <CursorPos X="20" Y="60"/>
    84         <UsageCount Value="10"/>
     85        <UsageCount Value="13"/>
    8586        <Loaded Value="True"/>
    8687      </Unit3>
     
    9192        <TopLine Value="33"/>
    9293        <CursorPos X="12" Y="56"/>
    93         <UsageCount Value="4"/>
     94        <UsageCount Value="3"/>
    9495      </Unit4>
    9596      <Unit5>
     
    99100        <TopLine Value="1"/>
    100101        <CursorPos X="23" Y="21"/>
    101         <UsageCount Value="4"/>
     102        <UsageCount Value="3"/>
    102103      </Unit5>
    103104      <Unit6>
     
    107108        <TopLine Value="1"/>
    108109        <CursorPos X="23" Y="24"/>
    109         <UsageCount Value="4"/>
     110        <UsageCount Value="3"/>
    110111      </Unit6>
    111112      <Unit7>
     
    115116        <TopLine Value="1"/>
    116117        <CursorPos X="23" Y="13"/>
    117         <UsageCount Value="4"/>
     118        <UsageCount Value="3"/>
    118119      </Unit7>
    119120      <Unit8>
     
    123124        <TopLine Value="1"/>
    124125        <CursorPos X="23" Y="24"/>
    125         <UsageCount Value="4"/>
     126        <UsageCount Value="3"/>
    126127      </Unit8>
    127128      <Unit9>
     
    131132        <TopLine Value="1"/>
    132133        <CursorPos X="31" Y="13"/>
    133         <UsageCount Value="4"/>
     134        <UsageCount Value="3"/>
    134135      </Unit9>
    135136      <Unit10>
     
    139140        <TopLine Value="1"/>
    140141        <CursorPos X="29" Y="17"/>
    141         <UsageCount Value="4"/>
     142        <UsageCount Value="3"/>
    142143      </Unit10>
    143144      <Unit11>
     
    146147        <TopLine Value="1"/>
    147148        <CursorPos X="1" Y="4"/>
    148         <UsageCount Value="4"/>
     149        <UsageCount Value="3"/>
    149150        <DefaultSyntaxHighlighter Value="None"/>
    150151      </Unit11>
     
    154155        <TopLine Value="1"/>
    155156        <CursorPos X="21" Y="6"/>
    156         <UsageCount Value="4"/>
     157        <UsageCount Value="3"/>
    157158        <DefaultSyntaxHighlighter Value="None"/>
    158159      </Unit12>
     
    162163        <TopLine Value="1"/>
    163164        <CursorPos X="1" Y="1"/>
    164         <UsageCount Value="4"/>
     165        <UsageCount Value="3"/>
    165166        <DefaultSyntaxHighlighter Value="None"/>
    166167      </Unit13>
     
    170171        <TopLine Value="1"/>
    171172        <CursorPos X="25" Y="13"/>
    172         <UsageCount Value="5"/>
     173        <UsageCount Value="4"/>
    173174        <DefaultSyntaxHighlighter Value="None"/>
    174175      </Unit14>
     
    178179        <TopLine Value="4"/>
    179180        <CursorPos X="3" Y="6"/>
    180         <UsageCount Value="4"/>
     181        <UsageCount Value="3"/>
    181182        <DefaultSyntaxHighlighter Value="None"/>
    182183      </Unit15>
     
    186187        <TopLine Value="1"/>
    187188        <CursorPos X="14" Y="16"/>
    188         <UsageCount Value="4"/>
     189        <UsageCount Value="3"/>
    189190        <DefaultSyntaxHighlighter Value="None"/>
    190191      </Unit16>
     
    195196        <TopLine Value="1"/>
    196197        <CursorPos X="32" Y="18"/>
    197         <UsageCount Value="4"/>
     198        <UsageCount Value="3"/>
    198199      </Unit17>
    199200      <Unit18>
     
    202203        <TopLine Value="1"/>
    203204        <CursorPos X="20" Y="12"/>
    204         <UsageCount Value="2"/>
     205        <UsageCount Value="1"/>
    205206        <DefaultSyntaxHighlighter Value="None"/>
    206207      </Unit18>
     
    211212        <TopLine Value="1"/>
    212213        <CursorPos X="1" Y="22"/>
    213         <UsageCount Value="2"/>
     214        <UsageCount Value="1"/>
    214215      </Unit19>
    215216      <Unit20>
     
    218219        <TopLine Value="1"/>
    219220        <CursorPos X="1" Y="1"/>
    220         <UsageCount Value="2"/>
     221        <UsageCount Value="1"/>
    221222        <DefaultSyntaxHighlighter Value="None"/>
    222223      </Unit20>
     
    226227        <TopLine Value="1"/>
    227228        <CursorPos X="1" Y="3"/>
    228         <UsageCount Value="2"/>
     229        <UsageCount Value="1"/>
    229230        <DefaultSyntaxHighlighter Value="None"/>
    230231      </Unit21>
     
    234235        <TopLine Value="1"/>
    235236        <CursorPos X="1" Y="3"/>
    236         <UsageCount Value="2"/>
     237        <UsageCount Value="1"/>
    237238        <DefaultSyntaxHighlighter Value="None"/>
    238239      </Unit22>
     
    243244        <TopLine Value="45"/>
    244245        <CursorPos X="9" Y="79"/>
    245         <UsageCount Value="1"/>
     246        <UsageCount Value="10"/>
    246247      </Unit23>
    247248      <Unit24>
     
    250251        <TopLine Value="1"/>
    251252        <CursorPos X="21" Y="4"/>
    252         <UsageCount Value="6"/>
     253        <UsageCount Value="5"/>
    253254        <DefaultSyntaxHighlighter Value="None"/>
    254255      </Unit24>
     
    259260        <TopLine Value="1"/>
    260261        <CursorPos X="1" Y="25"/>
    261         <UsageCount Value="6"/>
     262        <UsageCount Value="5"/>
    262263      </Unit25>
    263264      <Unit26>
     
    266267        <TopLine Value="1"/>
    267268        <CursorPos X="1" Y="3"/>
    268         <UsageCount Value="6"/>
     269        <UsageCount Value="5"/>
    269270        <DefaultSyntaxHighlighter Value="None"/>
    270271      </Unit26>
     
    274275        <TopLine Value="1"/>
    275276        <CursorPos X="7" Y="4"/>
    276         <UsageCount Value="6"/>
     277        <UsageCount Value="5"/>
    277278        <DefaultSyntaxHighlighter Value="None"/>
    278279      </Unit27>
     
    283284        <TopLine Value="1"/>
    284285        <CursorPos X="14" Y="15"/>
    285         <UsageCount Value="6"/>
     286        <UsageCount Value="5"/>
    286287      </Unit28>
    287288      <Unit29>
     
    290291        <TopLine Value="1"/>
    291292        <CursorPos X="14" Y="18"/>
    292         <UsageCount Value="6"/>
     293        <UsageCount Value="5"/>
    293294        <DefaultSyntaxHighlighter Value="None"/>
    294295      </Unit29>
     
    299300        <TopLine Value="2"/>
    300301        <CursorPos X="30" Y="8"/>
    301         <UsageCount Value="6"/>
     302        <UsageCount Value="5"/>
    302303      </Unit30>
    303304      <Unit31>
     
    307308        <TopLine Value="13"/>
    308309        <CursorPos X="15" Y="12"/>
    309         <UsageCount Value="8"/>
     310        <UsageCount Value="7"/>
    310311        <DefaultSyntaxHighlighter Value="Delphi"/>
    311312      </Unit31>
    312313      <Unit32>
    313314        <Filename Value="../Generic/GenericList.inc"/>
    314         <IsVisibleTab Value="True"/>
    315         <EditorIndex Value="2"/>
    316         <WindowIndex Value="0"/>
    317         <TopLine Value="359"/>
    318         <CursorPos X="62" Y="376"/>
     315        <EditorIndex Value="4"/>
     316        <WindowIndex Value="0"/>
     317        <TopLine Value="42"/>
     318        <CursorPos X="15" Y="55"/>
    319319        <UsageCount Value="107"/>
    320320        <Loaded Value="True"/>
     
    325325        <TopLine Value="31"/>
    326326        <CursorPos X="44" Y="47"/>
    327         <UsageCount Value="94"/>
     327        <UsageCount Value="93"/>
    328328      </Unit33>
    329329      <Unit34>
     
    332332        <TopLine Value="1"/>
    333333        <CursorPos X="36" Y="48"/>
    334         <UsageCount Value="94"/>
     334        <UsageCount Value="93"/>
    335335      </Unit34>
    336336      <Unit35>
     
    339339        <TopLine Value="3"/>
    340340        <CursorPos X="1" Y="3"/>
    341         <UsageCount Value="94"/>
     341        <UsageCount Value="93"/>
    342342      </Unit35>
    343343      <Unit36>
     
    346346        <TopLine Value="11"/>
    347347        <CursorPos X="42" Y="11"/>
    348         <UsageCount Value="94"/>
     348        <UsageCount Value="93"/>
    349349      </Unit36>
    350350      <Unit37>
     
    353353        <TopLine Value="3"/>
    354354        <CursorPos X="1" Y="3"/>
    355         <UsageCount Value="94"/>
     355        <UsageCount Value="93"/>
    356356      </Unit37>
    357357      <Unit38>
     
    360360        <TopLine Value="1"/>
    361361        <CursorPos X="22" Y="30"/>
    362         <UsageCount Value="94"/>
     362        <UsageCount Value="93"/>
    363363      </Unit38>
    364364      <Unit39>
     
    368368        <TopLine Value="6"/>
    369369        <CursorPos X="56" Y="36"/>
    370         <UsageCount Value="93"/>
     370        <UsageCount Value="92"/>
    371371      </Unit39>
    372372      <Unit40>
     
    376376        <TopLine Value="27"/>
    377377        <CursorPos X="50" Y="59"/>
    378         <UsageCount Value="92"/>
     378        <UsageCount Value="91"/>
    379379      </Unit40>
    380380      <Unit41>
     
    384384        <TopLine Value="57"/>
    385385        <CursorPos X="48" Y="85"/>
    386         <UsageCount Value="92"/>
     386        <UsageCount Value="91"/>
    387387      </Unit41>
    388388      <Unit42>
     
    391391        <TopLine Value="1"/>
    392392        <CursorPos X="33" Y="14"/>
    393         <UsageCount Value="92"/>
     393        <UsageCount Value="91"/>
    394394      </Unit42>
    395395      <Unit43>
     
    399399        <TopLine Value="52"/>
    400400        <CursorPos X="1" Y="81"/>
    401         <UsageCount Value="92"/>
     401        <UsageCount Value="91"/>
    402402      </Unit43>
    403403      <Unit44>
     
    407407        <TopLine Value="29"/>
    408408        <CursorPos X="1" Y="62"/>
    409         <UsageCount Value="92"/>
     409        <UsageCount Value="91"/>
    410410      </Unit44>
    411411      <Unit45>
     
    415415        <TopLine Value="9"/>
    416416        <CursorPos X="60" Y="36"/>
    417         <UsageCount Value="91"/>
     417        <UsageCount Value="90"/>
    418418      </Unit45>
    419419      <Unit46>
    420420        <Filename Value="../Generic/GenericMatrix.inc"/>
    421         <EditorIndex Value="3"/>
    422421        <WindowIndex Value="0"/>
    423422        <TopLine Value="9"/>
    424423        <CursorPos X="28" Y="23"/>
    425         <UsageCount Value="103"/>
    426         <Loaded Value="True"/>
     424        <UsageCount Value="102"/>
    427425      </Unit46>
    428426      <Unit47>
     
    432430        <TopLine Value="2624"/>
    433431        <CursorPos X="37" Y="2636"/>
    434         <UsageCount Value="90"/>
     432        <UsageCount Value="89"/>
    435433        <DefaultSyntaxHighlighter Value="Delphi"/>
    436434      </Unit47>
     
    440438        <TopLine Value="94"/>
    441439        <CursorPos X="1" Y="1"/>
    442         <UsageCount Value="6"/>
     440        <UsageCount Value="5"/>
    443441        <DefaultSyntaxHighlighter Value="XML"/>
    444442      </Unit48>
     
    448446        <TopLine Value="199"/>
    449447        <CursorPos X="14" Y="213"/>
    450         <UsageCount Value="28"/>
     448        <UsageCount Value="27"/>
    451449        <DefaultSyntaxHighlighter Value="Delphi"/>
    452450      </Unit49>
     
    456454        <TopLine Value="199"/>
    457455        <CursorPos X="3" Y="201"/>
    458         <UsageCount Value="28"/>
     456        <UsageCount Value="27"/>
    459457        <DefaultSyntaxHighlighter Value="Delphi"/>
    460458      </Unit50>
    461459      <Unit51>
    462460        <Filename Value="../Generic/GenericListObject.inc"/>
    463         <WindowIndex Value="0"/>
    464         <TopLine Value="1"/>
    465         <CursorPos X="21" Y="20"/>
     461        <EditorIndex Value="5"/>
     462        <WindowIndex Value="0"/>
     463        <TopLine Value="11"/>
     464        <CursorPos X="34" Y="24"/>
    466465        <UsageCount Value="19"/>
     466        <Loaded Value="True"/>
    467467      </Unit51>
    468468      <Unit52>
     
    472472        <TopLine Value="1"/>
    473473        <CursorPos X="27" Y="26"/>
    474         <UsageCount Value="28"/>
     474        <UsageCount Value="27"/>
    475475        <DefaultSyntaxHighlighter Value="Delphi"/>
    476476      </Unit52>
     
    480480        <TopLine Value="381"/>
    481481        <CursorPos X="3" Y="398"/>
    482         <UsageCount Value="28"/>
     482        <UsageCount Value="27"/>
    483483        <DefaultSyntaxHighlighter Value="Delphi"/>
    484484      </Unit53>
     
    488488        <TopLine Value="475"/>
    489489        <CursorPos X="10" Y="503"/>
    490         <UsageCount Value="7"/>
     490        <UsageCount Value="6"/>
    491491        <DefaultSyntaxHighlighter Value="Delphi"/>
    492492      </Unit54>
     
    496496        <TopLine Value="2270"/>
    497497        <CursorPos X="22" Y="2273"/>
    498         <UsageCount Value="19"/>
     498        <UsageCount Value="18"/>
    499499        <DefaultSyntaxHighlighter Value="Delphi"/>
    500500      </Unit55>
     
    502502        <Filename Value="../Specialized/SpecializedMatrix.pas"/>
    503503        <UnitName Value="SpecializedMatrix"/>
    504         <EditorIndex Value="4"/>
    505504        <WindowIndex Value="0"/>
    506505        <TopLine Value="1"/>
    507506        <CursorPos X="25" Y="41"/>
    508507        <UsageCount Value="19"/>
    509         <Loaded Value="True"/>
    510508      </Unit56>
    511509      <Unit57>
     
    514512        <TopLine Value="1"/>
    515513        <CursorPos X="28" Y="10"/>
    516         <UsageCount Value="9"/>
     514        <UsageCount Value="8"/>
    517515        <DefaultSyntaxHighlighter Value="None"/>
    518516      </Unit57>
     
    522520        <TopLine Value="38"/>
    523521        <CursorPos X="3" Y="50"/>
    524         <UsageCount Value="11"/>
     522        <UsageCount Value="10"/>
    525523        <DefaultSyntaxHighlighter Value="Delphi"/>
    526524      </Unit58>
     
    530528        <TopLine Value="649"/>
    531529        <CursorPos X="38" Y="671"/>
    532         <UsageCount Value="10"/>
     530        <UsageCount Value="9"/>
    533531        <DefaultSyntaxHighlighter Value="Delphi"/>
    534532      </Unit59>
     
    538536        <TopLine Value="1185"/>
    539537        <CursorPos X="22" Y="1196"/>
    540         <UsageCount Value="10"/>
     538        <UsageCount Value="9"/>
    541539        <DefaultSyntaxHighlighter Value="Delphi"/>
    542540      </Unit60>
     
    547545        <TopLine Value="112"/>
    548546        <CursorPos X="3" Y="124"/>
    549         <UsageCount Value="10"/>
     547        <UsageCount Value="9"/>
    550548        <DefaultSyntaxHighlighter Value="Delphi"/>
    551549      </Unit61>
     
    555553        <TopLine Value="71"/>
    556554        <CursorPos X="10" Y="84"/>
    557         <UsageCount Value="10"/>
     555        <UsageCount Value="9"/>
     556        <DefaultSyntaxHighlighter Value="Delphi"/>
    558557      </Unit62>
    559558      <Unit63>
     
    562561        <TopLine Value="148"/>
    563562        <CursorPos X="11" Y="169"/>
    564         <UsageCount Value="10"/>
     563        <UsageCount Value="9"/>
     564        <DefaultSyntaxHighlighter Value="Delphi"/>
    565565      </Unit63>
    566566      <Unit64>
     
    569569        <TopLine Value="511"/>
    570570        <CursorPos X="11" Y="524"/>
    571         <UsageCount Value="10"/>
     571        <UsageCount Value="9"/>
     572        <DefaultSyntaxHighlighter Value="Delphi"/>
    572573      </Unit64>
    573574      <Unit65>
     
    576577        <TopLine Value="411"/>
    577578        <CursorPos X="10" Y="424"/>
     579        <UsageCount Value="9"/>
     580        <DefaultSyntaxHighlighter Value="Delphi"/>
     581      </Unit65>
     582      <Unit66>
     583        <Filename Value="../Specialized/SpecializedStream.pas"/>
     584        <UnitName Value="SpecializedStream"/>
     585        <IsVisibleTab Value="True"/>
     586        <EditorIndex Value="8"/>
     587        <WindowIndex Value="0"/>
     588        <TopLine Value="106"/>
     589        <CursorPos X="48" Y="107"/>
     590        <UsageCount Value="13"/>
     591        <Loaded Value="True"/>
     592      </Unit66>
     593      <Unit67>
     594        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/lcl/lclclasses.pp"/>
     595        <UnitName Value="LCLClasses"/>
     596        <WindowIndex Value="0"/>
     597        <TopLine Value="25"/>
     598        <CursorPos X="32" Y="40"/>
     599        <UsageCount Value="9"/>
     600      </Unit67>
     601      <Unit68>
     602        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/lcl/controls.pp"/>
     603        <UnitName Value="Controls"/>
     604        <WindowIndex Value="0"/>
     605        <TopLine Value="1"/>
     606        <CursorPos X="39" Y="11"/>
     607        <UsageCount Value="9"/>
     608      </Unit68>
     609      <Unit69>
     610        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/objpash.inc"/>
     611        <WindowIndex Value="0"/>
     612        <TopLine Value="179"/>
     613        <CursorPos X="23" Y="192"/>
    578614        <UsageCount Value="10"/>
    579       </Unit65>
     615      </Unit69>
     616      <Unit70>
     617        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/objpas.inc"/>
     618        <WindowIndex Value="0"/>
     619        <TopLine Value="265"/>
     620        <CursorPos X="9" Y="267"/>
     621        <UsageCount Value="10"/>
     622      </Unit70>
     623      <Unit71>
     624        <Filename Value="../Generic/GenericStream.inc"/>
     625        <EditorIndex Value="7"/>
     626        <WindowIndex Value="0"/>
     627        <TopLine Value="1"/>
     628        <CursorPos X="13" Y="12"/>
     629        <UsageCount Value="13"/>
     630        <Loaded Value="True"/>
     631      </Unit71>
     632      <Unit72>
     633        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/objpas/classes/classesh.inc"/>
     634        <EditorIndex Value="1"/>
     635        <WindowIndex Value="0"/>
     636        <TopLine Value="891"/>
     637        <CursorPos X="18" Y="908"/>
     638        <UsageCount Value="11"/>
     639        <Loaded Value="True"/>
     640      </Unit72>
     641      <Unit73>
     642        <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/objpas/classes/streams.inc"/>
     643        <EditorIndex Value="2"/>
     644        <WindowIndex Value="0"/>
     645        <TopLine Value="739"/>
     646        <CursorPos X="18" Y="750"/>
     647        <UsageCount Value="11"/>
     648        <Loaded Value="True"/>
     649      </Unit73>
     650      <Unit74>
     651        <Filename Value="../Generic/GenericListString.inc"/>
     652        <EditorIndex Value="6"/>
     653        <WindowIndex Value="0"/>
     654        <TopLine Value="8"/>
     655        <CursorPos X="34" Y="21"/>
     656        <UsageCount Value="10"/>
     657        <Loaded Value="True"/>
     658      </Unit74>
    580659    </Units>
    581     <JumpHistory Count="30" HistoryIndex="27">
     660    <JumpHistory Count="30" HistoryIndex="28">
    582661      <Position1>
    583         <Filename Value="../Generic/GenericList.inc"/>
    584         <Caret Line="468" Column="70" TopLine="462"/>
     662        <Filename Value="UMainForm.pas"/>
     663        <Caret Line="142" Column="1" TopLine="128"/>
    585664      </Position1>
    586665      <Position2>
    587         <Filename Value="../Generic/GenericList.inc"/>
    588         <Caret Line="469" Column="1" TopLine="462"/>
     666        <Filename Value="UMainForm.pas"/>
     667        <Caret Line="143" Column="1" TopLine="128"/>
    589668      </Position2>
    590669      <Position3>
    591670        <Filename Value="../Generic/GenericList.inc"/>
    592         <Caret Line="470" Column="1" TopLine="462"/>
     671        <Caret Line="161" Column="1" TopLine="148"/>
    593672      </Position3>
    594673      <Position4>
    595         <Filename Value="../Generic/GenericList.inc"/>
    596         <Caret Line="471" Column="1" TopLine="462"/>
     674        <Filename Value="../Specialized/SpecializedStream.pas"/>
     675        <Caret Line="93" Column="21" TopLine="80"/>
    597676      </Position4>
    598677      <Position5>
    599         <Filename Value="../Generic/GenericList.inc"/>
    600         <Caret Line="470" Column="5" TopLine="462"/>
     678        <Filename Value="UMainForm.pas"/>
     679        <Caret Line="150" Column="22" TopLine="129"/>
    601680      </Position5>
    602681      <Position6>
    603         <Filename Value="UMainForm.pas"/>
    604         <Caret Line="237" Column="19" TopLine="232"/>
     682        <Filename Value="../Generic/GenericStream.inc"/>
     683        <Caret Line="22" Column="12" TopLine="9"/>
    605684      </Position6>
    606685      <Position7>
    607         <Filename Value="UMainForm.pas"/>
    608         <Caret Line="237" Column="19" TopLine="232"/>
     686        <Filename Value="../Generic/GenericStream.inc"/>
     687        <Caret Line="37" Column="18" TopLine="35"/>
    609688      </Position7>
    610689      <Position8>
    611690        <Filename Value="UMainForm.pas"/>
    612         <Caret Line="495" Column="26" TopLine="482"/>
     691        <Caret Line="157" Column="79" TopLine="132"/>
    613692      </Position8>
    614693      <Position9>
    615         <Filename Value="UMainForm.pas"/>
    616         <Caret Line="503" Column="9" TopLine="490"/>
     694        <Filename Value="../Specialized/SpecializedStream.pas"/>
     695        <Caret Line="58" Column="45" TopLine="46"/>
    617696      </Position9>
    618697      <Position10>
    619         <Filename Value="UMainForm.pas"/>
    620         <Caret Line="480" Column="3" TopLine="467"/>
     698        <Filename Value="../Specialized/SpecializedStream.pas"/>
     699        <Caret Line="119" Column="12" TopLine="100"/>
    621700      </Position10>
    622701      <Position11>
    623         <Filename Value="UMainForm.pas"/>
    624         <Caret Line="511" Column="32" TopLine="498"/>
     702        <Filename Value="../Generic/GenericList.inc"/>
     703        <Caret Line="197" Column="39" TopLine="182"/>
    625704      </Position11>
    626705      <Position12>
    627         <Filename Value="UMainForm.pas"/>
    628         <Caret Line="519" Column="33" TopLine="506"/>
     706        <Filename Value="../Specialized/SpecializedStream.pas"/>
     707        <Caret Line="119" Column="12" TopLine="100"/>
    629708      </Position12>
    630709      <Position13>
    631         <Filename Value="UMainForm.pas"/>
    632         <Caret Line="526" Column="26" TopLine="513"/>
     710        <Filename Value="../Specialized/SpecializedStream.pas"/>
     711        <Caret Line="61" Column="38" TopLine="48"/>
    633712      </Position13>
    634713      <Position14>
    635         <Filename Value="UMainForm.pas"/>
    636         <Caret Line="538" Column="27" TopLine="525"/>
     714        <Filename Value="../Specialized/SpecializedStream.pas"/>
     715        <Caret Line="130" Column="15" TopLine="117"/>
    637716      </Position14>
    638717      <Position15>
    639         <Filename Value="UMainForm.pas"/>
    640         <Caret Line="549" Column="26" TopLine="536"/>
     718        <Filename Value="../Specialized/SpecializedStream.pas"/>
     719        <Caret Line="64" Column="36" TopLine="51"/>
    641720      </Position15>
    642721      <Position16>
    643         <Filename Value="UMainForm.pas"/>
    644         <Caret Line="561" Column="25" TopLine="548"/>
     722        <Filename Value="../Specialized/SpecializedStream.pas"/>
     723        <Caret Line="58" Column="29" TopLine="45"/>
    645724      </Position16>
    646725      <Position17>
    647         <Filename Value="UMainForm.pas"/>
    648         <Caret Line="572" Column="16" TopLine="559"/>
     726        <Filename Value="../Specialized/SpecializedStream.pas"/>
     727        <Caret Line="78" Column="45" TopLine="78"/>
    649728      </Position17>
    650729      <Position18>
    651         <Filename Value="UMainForm.pas"/>
    652         <Caret Line="584" Column="25" TopLine="571"/>
     730        <Filename Value="../Specialized/SpecializedStream.pas"/>
     731        <Caret Line="64" Column="64" TopLine="48"/>
    653732      </Position18>
    654733      <Position19>
    655         <Filename Value="UMainForm.pas"/>
    656         <Caret Line="595" Column="26" TopLine="582"/>
     734        <Filename Value="../Specialized/SpecializedStream.pas"/>
     735        <Caret Line="82" Column="3" TopLine="68"/>
    657736      </Position19>
    658737      <Position20>
    659         <Filename Value="../Generic/GenericList.inc"/>
    660         <Caret Line="214" Column="12" TopLine="201"/>
     738        <Filename Value="../Generic/GenericListObject.inc"/>
     739        <Caret Line="20" Column="21" TopLine="1"/>
    661740      </Position20>
    662741      <Position21>
    663         <Filename Value="../Generic/GenericList.inc"/>
    664         <Caret Line="231" Column="16" TopLine="218"/>
     742        <Filename Value="../Generic/GenericListObject.inc"/>
     743        <Caret Line="24" Column="17" TopLine="11"/>
    665744      </Position21>
    666745      <Position22>
    667         <Filename Value="UMainForm.pas"/>
    668         <Caret Line="634" Column="11" TopLine="614"/>
     746        <Filename Value="../Generic/GenericListString.inc"/>
     747        <Caret Line="1" Column="1" TopLine="1"/>
    669748      </Position22>
    670749      <Position23>
    671750        <Filename Value="UMainForm.pas"/>
    672         <Caret Line="628" Column="39" TopLine="624"/>
     751        <Caret Line="43" Column="15" TopLine="28"/>
    673752      </Position23>
    674753      <Position24>
    675         <Filename Value="UMainForm.pas"/>
    676         <Caret Line="91" Column="5" TopLine="77"/>
     754        <Filename Value="../Generic/GenericStream.inc"/>
     755        <Caret Line="13" Column="1" TopLine="1"/>
    677756      </Position24>
    678757      <Position25>
    679         <Filename Value="UMainForm.pas"/>
    680         <Caret Line="92" Column="61" TopLine="77"/>
     758        <Filename Value="../Specialized/SpecializedStream.pas"/>
     759        <Caret Line="84" Column="35" TopLine="40"/>
    681760      </Position25>
    682761      <Position26>
    683         <Filename Value="UMainForm.pas"/>
    684         <Caret Line="91" Column="52" TopLine="74"/>
     762        <Filename Value="../Specialized/SpecializedStream.pas"/>
     763        <Caret Line="126" Column="39" TopLine="111"/>
    685764      </Position26>
    686765      <Position27>
    687         <Filename Value="../Generic/GenericList.inc"/>
    688         <Caret Line="3" Column="69" TopLine="1"/>
     766        <Filename Value="../Specialized/SpecializedStream.pas"/>
     767        <Caret Line="128" Column="1" TopLine="111"/>
    689768      </Position27>
    690769      <Position28>
    691         <Filename Value="../Generic/GenericList.inc"/>
    692         <Caret Line="27" Column="24" TopLine="7"/>
     770        <Filename Value="../Specialized/SpecializedStream.pas"/>
     771        <Caret Line="68" Column="32" TopLine="55"/>
    693772      </Position28>
    694773      <Position29>
    695         <Filename Value="../Generic/GenericList.inc"/>
    696         <Caret Line="217" Column="27" TopLine="209"/>
     774        <Filename Value="../Specialized/SpecializedStream.pas"/>
     775        <Caret Line="121" Column="1" TopLine="106"/>
    697776      </Position29>
    698777      <Position30>
    699778        <Filename Value="../Generic/GenericList.inc"/>
    700         <Caret Line="237" Column="18" TopLine="223"/>
     779        <Caret Line="55" Column="15" TopLine="42"/>
    701780      </Position30>
    702781    </JumpHistory>
    703782  </ProjectOptions>
    704783  <CompilerOptions>
    705     <Version Value="10"/>
     784    <Version Value="11"/>
    706785    <Target>
    707786      <Filename Value="Demo"/>
     
    730809    <Linking>
    731810      <Debugging>
    732         <GenerateDebugInfo Value="True"/>
     811        <DebugInfoType Value="dsStabs"/>
    733812        <UseHeaptrc Value="True"/>
    734813      </Debugging>
  • Generics/TemplateGenerics/Demo/UMainForm.lfm

    r270 r312  
    4848  end
    4949  object ButtonCharList: TButton
    50     Left = 7
     50    Left = 8
    5151    Height = 25
    5252    Top = 134
    53     Width = 129
     53    Width = 128
    5454    Caption = 'TListChar(TString)'
    5555    OnClick = ButtonCharListClick
     
    5757  end
    5858  object ButtonBenchmarkListString: TButton
    59     Left = 10
     59    Left = 8
    6060    Height = 24
    6161    Top = 456
     
    6767  end
    6868  object ButtonListObject: TButton
    69     Left = 7
     69    Left = 8
    7070    Height = 25
    7171    Top = 163
    72     Width = 129
     72    Width = 128
    7373    Caption = 'TListObject'
    7474    OnClick = ButtonListObjectClick
     
    7676  end
    7777  object ButtonBenchmarkDictionary: TButton
    78     Left = 10
     78    Left = 8
    7979    Height = 25
    8080    Top = 424
    81     Width = 126
     81    Width = 128
    8282    Anchors = [akLeft, akBottom]
    8383    Caption = 'TDictionaryStringString'
     
    8686  end
    8787  object ButtonMatrixInteger: TButton
    88     Left = 7
     88    Left = 8
    8989    Height = 25
    9090    Top = 192
    91     Width = 129
     91    Width = 128
    9292    Caption = 'TMatrixInteger'
    9393    OnClick = ButtonMatrixIntegerClick
     
    140140    TabOrder = 10
    141141  end
     142  object ButtonStreamByte: TButton
     143    Left = 10
     144    Height = 25
     145    Top = 224
     146    Width = 128
     147    Caption = 'TMemoryStreamByte'
     148    OnClick = ButtonStreamByteClick
     149    TabOrder = 11
     150  end
    142151end
  • Generics/TemplateGenerics/Demo/UMainForm.pas

    r270 r312  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    99  ComCtrls, SpecializedList, SpecializedDictionary, SpecializedQueue,
    10   DateUtils, SpecializedMatrix;
     10  DateUtils, SpecializedMatrix, SpecializedStream;
    1111
    1212type
     
    1515
    1616  TMainForm = class(TForm)
     17    ButtonStreamByte: TButton;
    1718    ButtonBenchmarkDictionary: TButton;
    1819    ButtonBenchmarkListPointer: TButton;
     
    3839    procedure ButtonQueueIntegerClick(Sender: TObject);
    3940    procedure ButtonStringListClick(Sender: TObject);
     41    procedure ButtonStreamByteClick(Sender: TObject);
    4042    procedure FormCreate(Sender: TObject);
    4143    procedure FormDestroy(Sender: TObject);
    42   private
    4344  public
    4445    MeasureDuration: TDateTime;
     
    9495    List2.SetArray([2, 0]);
    9596    WriteOutput('EqualTo([7, 11])', BoolToStr(EqualTo(List2)));
     97    InsertCount(0, 3);
     98    WriteOutput('InsertCount(0, 3)', Implode(',', IntToStr));
     99    Fill(0, 3, 9);
     100    WriteOutput('Fill(0, 3, 9)', Implode(',', IntToStr));
    96101  finally
    97102    Free;
     
    119124    WriteOutput('Clear', '[' + Implode('; ', ', ', IntToStr) + ']');
    120125    WriteOutput('Count [Y, X]', IntToStr(Count.Y) + ', ' + IntToStr(Count.X));
     126  finally
     127    Free;
     128  end;
     129end;
     130
     131procedure TMainForm.ButtonStreamByteClick(Sender: TObject);
     132var
     133  Stream: TMemoryStreamByte;
     134  I: Integer;
     135  ByteArray: array of Byte;
     136  ByteArrayText: string;
     137begin
     138  ListViewOutput.Clear;
     139  LabelTestName.Caption := 'TStreamByte test';
     140  Stream := TMemoryStreamByte.Create;
     141  with Stream do try
     142    WriteOutput('Size := ', IntToStr(Stream.Size));
     143    Write(1);
     144    WriteOutput('Write(1)', '');
     145    WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position));
     146    WriteArray([2, 3, 4]);
     147    WriteOutput('WriteArray([2, 3, 4])', '');
     148    WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position));
     149    Position := 1;
     150    WriteOutput('Position := 1', '');
     151    WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position));
     152    WriteOutput('Read', IntToStr(Read));
     153    WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position));
     154    ByteArray := ReadArray(2);
     155    ByteArrayText := '[';
     156    for I := 0 to Length(ByteArray) - 1 do begin
     157      ByteArrayText := ByteArrayText + IntToStr(ByteArray[I]);
     158      if I < Length(ByteArray) - 1 then ByteArrayText := ByteArrayText + ', ';
     159    end;
     160    ByteArrayText := ByteArrayText + ']';
     161    WriteOutput('ReadArray', ByteArrayText);
     162    WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position));
    121163  finally
    122164    Free;
     
    702744    MoveItems(2, 3, 3);
    703745    WriteOutput('Implode', Implode(',', StrToStr));
     746    InsertCount(0, 3);
     747    WriteOutput('InsertCount(0, 3)', Implode(',', StrToStr));
     748    Fill(0, 3, 'Zero');
     749    WriteOutput('Fill(0, 3, ''Zero'')', Implode(',', StrToStr));
    704750  finally
    705751    Free;
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r308 r312  
    11{$IFDEF INTERFACE}
     2
     3  // TGList implemented using templates
     4  // - item operations (Add, Insert, ReplaceArray, Get, Set, IndexOf,
     5  //   Extract, Delete, Exchange)
     6  // - item range operations (DeleteItems, InsertItems, ReplaceItems,
     7  //   Move, Fill)
     8  // - other TGList operations (AddList, InsertList,
     9  //   ReplaceList, GetList, IndexOfList)
     10  // - dynamic array operations (AddArray, InsertArray,
     11  //   ReplaceArray, GetArray, IndexOfArray)
     12  // - all items operations (Clear, Reverse, Sort)
    213
    314  TGList = class;
     
    4152    property First: TGListItem read GetFirst write SetFirst;
    4253    procedure Fill(Start, Count: TGListIndex; Value: TGListItem);
    43     function GetArray: TGListItemArray;
     54    function GetArray(Index, ACount: TGListIndex): TGListItemArray;
     55    procedure GetList(List: TGList; Index, ACount: TGListIndex);
    4456    function Implode(Separator: string; Converter: TGListToStringConverter): string;
    4557    function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual;
    4658    function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex;
     59    function IndexOfArray(Values: array of TGListItem; Start: TGListIndex = 0): TGListIndex;
    4760    procedure Insert(Index: TGListIndex; Item: TGListItem);
    4861    procedure InsertList(Index: TGListIndex; List: TGList);
    4962    procedure InsertArray(Index: TGListIndex; Values: array of TGListItem);
     63    procedure InsertCount(Index: TGListIndex; ACount: TGListIndex);
    5064    procedure Move(CurIndex, NewIndex: TGListIndex);
    5165    procedure MoveItems(CurIndex, NewIndex, Count: TGListIndex);
    5266    function Remove(Item: TGListItem): TGListIndex;
    5367    procedure Reverse;
     68    procedure ReplaceArray(Index: TGListIndex; Values: array of TGListItem);
    5469    procedure ReplaceList(Index: TGListIndex; Source: TGList);
    5570    procedure ReplaceListPart(Index: TGListIndex; Source: TGList;
     
    8398end;
    8499
     100procedure TGList.ReplaceArray(Index: TGListIndex; Values: array of TGListItem);
     101var
     102  I: TGListIndex;
     103begin
     104  I := 0;
     105  while I < Length(Values) do begin
     106    Items[Index + I] := Values[I];
     107    I := I + 1;
     108  end;
     109end;
     110
    85111procedure TGList.ReplaceList(Index: TGListIndex; Source: TGList);
    86112var
     
    165191end;
    166192
    167 function TGList.GetArray: TGListItemArray;
     193function TGList.GetArray(Index, ACount: TGListIndex): TGListItemArray;
    168194var
    169195  I: Integer;
    170196begin
    171   SetLength(Result, Count);
     197  SetLength(Result, ACount);
    172198  I := 0;
    173199  while I < Count do begin
    174     Result[I] := FItems[I];
    175     I := I + 1;
    176   end;
     200    Result[I] := FItems[Index + I];
     201    I := I + 1;
     202  end;
     203end;
     204
     205procedure TGList.GetList(List: TGList; Index, ACount: TGListIndex);
     206begin
     207  List.Clear;
     208  List.AddListPart(Self, Index, ACount);
    177209end;
    178210
     
    258290procedure TGList.Insert(Index: TGListIndex; Item: TGListItem);
    259291begin
    260   if (Index < 0) or (Index > FCount ) then
     292  if (Index < 0) or (Index > FCount) then
    261293    raise EListError.CreateFmt(SListIndexError, [Index]);
    262   if FCount = Capacity then SetCapacityOptimized(Capacity + 1);
     294  InsertCount(Index, 1);
     295  FItems[Index] := Item;
     296end;
     297
     298procedure TGList.InsertList(Index: TGListIndex; List: TGList);
     299begin
     300  if (Index < 0) or (Index > FCount) then
     301    raise EListError.CreateFmt(SListIndexError, [Index]);
     302  InsertCount(Index, List.Count);
     303  ReplaceList(Index, List);
     304end;
     305
     306procedure TGList.InsertArray(Index: TGListIndex; Values: array of TGListItem);
     307begin
     308  if (Index < 0) or (Index > FCount) then
     309    raise EListError.CreateFmt(SListIndexError, [Index]);
     310  InsertCount(Index, Length(Values));
     311  ReplaceArray(Index, Values);
     312end;
     313
     314procedure TGList.InsertCount(Index: TGListIndex; ACount: TGListIndex);
     315begin
     316  if (Index < 0) or (Index > FCount) then
     317    raise EListError.CreateFmt(SListIndexError, [Index]);
     318  Count := Count + ACount;
    263319  if Index < FCount then
    264     System.Move(FItems[Index], FItems[Index + 1], (FCount - Index) * SizeOf(TGListItem));
    265   FItems[Index] := Item;
    266   FCount := FCount + 1;
    267 end;
    268 
    269 procedure TGList.InsertList(Index: TGListIndex; List: TGList);
    270 var
    271   I: TGListIndex;
    272 begin
    273   I := 0;
    274   while (I < List.Count) do begin
    275     Insert(Index + I, List[I]);
    276     I := I + 1;
    277   end;
     320    System.Move(FItems[Index], FItems[Index + ACount], (FCount - ACount - Index) * SizeOf(TGListItem));
    278321end;
    279322
     
    297340end;
    298341
     342function TGList.IndexOfArray(Values: array of TGListItem; Start: TGListIndex): TGListIndex;
     343var
     344  I: TGListIndex;
     345begin
     346  if Length(Values) > 0 then begin
     347    Result := IndexOf(Values[0], Start);
     348    if Result <> -1 then begin
     349      I := 1;
     350      while I < Length(Values) do begin
     351        if not CompareMem(Addr(FItems[Result + I]), Addr(Values[I]), SizeOf(TGListItem)) then begin
     352          Result := -1;
     353          Break;
     354        end;
     355        I := I + 1;
     356      end;
     357    end;
     358  end else Result := -1;
     359end;
     360
    299361function TGList.GetLast: TGListItem;
    300362begin
     
    438500end;
    439501
    440 procedure TGList.InsertArray(Index: TGListIndex; Values: array of TGListItem);
    441 var
    442   I: TGListIndex;
    443 begin
    444   I := 0;
    445   while I <= High(Values) do begin
    446     Insert(Index + I, Values[I]);
    447     I := I + 1;
    448   end;
    449 end;
    450 
    451502function TGList.Implode(Separator: string; Converter: TGListToStringConverter): string;
    452503var
  • Generics/TemplateGenerics/Generic/GenericListObject.inc

    r257 r312  
    2222    procedure Clear; override;
    2323    procedure Assign(Source: TGList); override;
    24     constructor Create;
     24    constructor Create; override;
    2525    destructor Destroy; override;
    2626  end;
  • Generics/TemplateGenerics/Generic/GenericListString.inc

    r258 r312  
    1919    procedure Assign(Source: TGList); override;
    2020    function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; override;
    21     constructor Create;
     21    constructor Create; override;
    2222    destructor Destroy; override;
    2323  end;
  • Generics/TemplateGenerics/Generic/GenericQueue.inc

    r112 r312  
    1111{$I 'GenericList.inc'}
    1212
    13   // TGQueue<TSetIndex, TSetItem> = class(TGList)
     13  // TGQueue<TQueueIndex, TQueueItem> = class(TGList)
    1414  TGQueue = class
    1515  private
    1616    FList: TGList;
     17    function GetCount: TGQueueIndex;
    1718  public
    1819    procedure Enqueue(Value: TGQueueItem);
     20    procedure EnqueueArray(Values: array of TGQueueItem);
     21    procedure EnqueueList(List: TGList);
    1922    function Dequeue: TGQueueItem;
    2023    function Peek: TGQueueItem;
     
    2225    destructor Destroy; override;
    2326    property List: TGList read FList;
     27    property Count: TGQueueIndex read GetCount;
    2428  end;
    2529
     
    5458end;
    5559
     60procedure TGQueue.EnqueueArray(Values: array of TGQueueItem);
     61begin
     62  FList.AddArray(Values);
     63end;
     64
     65procedure TGQueue.EnqueueList(List: TGList);
     66begin
     67  FList.AddList(List);
     68end;
     69
    5670function TGQueue.Peek: TGQueueItem;
    5771begin
     
    7589end;
    7690
     91function TGQueue.GetCount: TGQueueIndex;
     92begin
     93  Result := FList.Count;
     94end;
     95
    7796{$UNDEF IMPLEMENTATION}
    7897{$ENDIF}
  • Generics/TemplateGenerics/Generic/GenericStream.inc

    r226 r312  
    11{$IFDEF INTERFACE}
    22
    3 TGStreamDataEvent = procedure (Item: TGStreamItem) of object;
     3TGStreamItemArray = array of TGStreamItem;
    44
    5 // TGStream<TStreamItem> = class
     5// TGStream<TGStreamIndex, TGStreamItem> = class
    66TGStream = class
    7   FOnData: TGStreamDataEvent;
    8   procedure Write(Item: TStreamItem);
    9   property OnData: TGStreamDataEvent read FOnData write FOnData;
     7  procedure SetSize(AValue: TGStreamIndex);
     8  function GetSize: TGStreamIndex;
     9  procedure SetPosition(AValue: TGStreamIndex);
     10  function GetPosition: TGStreamIndex;
     11public
     12  procedure Assign(Source: TGStream); virtual;
     13  procedure Write(Item: TGStreamItem); virtual; abstract;
     14  procedure WriteArray(Item: array of TGStreamItem); virtual; abstract;
     15  function Read: TGStreamItem; virtual; abstract;
     16  function ReadArray(Count: TGStreamIndex): TGStreamItemArray; virtual; abstract;
     17  function Insert(Count: TGStreamIndex): TGStreamIndex; virtual; abstract;
     18  function Remove(Count: TGStreamIndex): TGStreamIndex; virtual; abstract;
     19  function Seek(Offset: TGStreamIndex; Origin: TSeekOrigin = soCurrent):
     20    TGStreamIndex; virtual; abstract;
     21  constructor Create; virtual;
     22  property Position: TGStreamIndex read GetPosition write SetPosition;
     23  property Size: TGStreamIndex read GetSize write SetSize;
    1024end;
    1125
     
    1529{$IFDEF IMPLEMENTATION}
    1630
    17 procedure TGStream.Write(Item: TGStreamItem);
     31procedure TGStream.Assign(Source: TGStream);
    1832begin
    19   if Assigned(FOnData) then
    20     FOnData(Item);
    2133end;
    2234
     35procedure TGStream.SetPosition(AValue: TGStreamIndex);
     36begin
     37  Seek(AValue, soBegin);
     38end;
     39
     40function TGStream.GetPosition: TGStreamIndex;
     41begin
     42  Result := Seek(0, soCurrent);
     43end;
     44
     45procedure TGStream.SetSize(AValue: TGStreamIndex);
     46var
     47  StreamSize: TGStreamIndex;
     48  OldPosition: TGStreamIndex;
     49begin
     50  OldPosition := Seek(0, soCurrent);
     51  StreamSize := Size;
     52  if AValue > StreamSize then begin
     53    Seek(StreamSize, soBegin);
     54    Insert(AValue - StreamSize);
     55  end else
     56  if AValue < StreamSize then begin
     57    Seek(AValue, soBegin);
     58    Remove(StreamSize - AValue);
     59  end;
     60  Position := OldPosition;
     61end;
     62
     63function TGStream.GetSize: TGStreamIndex;
     64var
     65  OldPosition: Integer;
     66begin
     67  OldPosition := Position;
     68  Result := Seek(0, soEnd);
     69  Position := OldPosition;
     70end;
     71
     72constructor TGStream.Create;
     73begin
     74  inherited;
     75end;
    2376
    2477{$UNDEF IMPLEMENTATION}
  • Generics/TemplateGenerics/TemplateGenerics.lpk

    r257 r312  
    11<?xml version="1.0"?>
    22<CONFIG>
    3   <Package Version="3">
     3  <Package Version="4">
    44    <PathDelim Value="\"/>
    55    <Name Value="TemplateGenerics"/>
     6    <AddToProjectUsesSection Value="True"/>
    67    <Author Value="Chronos (robie@centrum.cz)"/>
    78    <CompilerOptions>
    8       <Version Value="10"/>
     9      <Version Value="11"/>
    910      <PathDelim Value="\"/>
    1011      <SearchPaths>
     
    2829    <Description Value="Generic classes implemented as templates."/>
    2930    <Version Minor="3"/>
    30     <Files Count="23">
     31    <Files Count="24">
    3132      <Item1>
    3233        <Filename Value="ReadMe.txt"/>
     
    121122        <UnitName Value="SpecializedBitmap"/>
    122123      </Item23>
     124      <Item24>
     125        <Filename Value="Specialized\SpecializedStream.pas"/>
     126        <UnitName Value="SpecializedStack"/>
     127      </Item24>
    123128    </Files>
    124129    <Type Value="RunAndDesignTime"/>
  • Generics/TemplateGenerics/TemplateGenerics.pas

    r257 r312  
    1010  SpecializedList, SpecializedDictionary, SpecializedStack, SpecializedTree,
    1111  SpecializedQueue, SpecializedSet, SpecializedPoint, SpecializedMatrix,
    12   SpecializedBitmap, LazarusPackageIntf;
     12  SpecializedBitmap, SpecializedStream, LazarusPackageIntf;
    1313
    1414implementation
Note: See TracChangeset for help on using the changeset viewer.