Changeset 458
- Timestamp:
- Nov 28, 2012, 7:50:19 AM (12 years ago)
- Location:
- Generics/NativeGenerics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/NativeGenerics/Demo/Demo.lpi
r425 r458 33 33 <Item1> 34 34 <PackageName Value="NativeGenerics"/> 35 <DefaultFilename Value="../NativeGenerics.lpk" Prefer="True"/> 35 36 </Item1> 36 37 <Item2> … … 38 39 </Item2> 39 40 </RequiredPackages> 40 <Units Count="7 5">41 <Units Count="77"> 41 42 <Unit0> 42 43 <Filename Value="Demo.lpr"/> … … 56 57 <ResourceBaseClass Value="Form"/> 57 58 <UnitName Value="UMainForm"/> 58 <EditorIndex Value=" 1"/>59 <WindowIndex Value="0"/> 60 <TopLine Value="65 2"/>61 <CursorPos X="1 1" Y="657"/>59 <EditorIndex Value="2"/> 60 <WindowIndex Value="0"/> 61 <TopLine Value="653"/> 62 <CursorPos X="1" Y="657"/> 62 63 <UsageCount Value="233"/> 63 64 <Bookmarks Count="1"> … … 346 347 <UnitName Value="GenericList"/> 347 348 <IsVisibleTab Value="True"/> 348 <EditorIndex Value=" 5"/>349 <WindowIndex Value="0"/> 350 <TopLine Value=" 31"/>351 <CursorPos X=" 28" Y="44"/>352 <UsageCount Value="6 4"/>349 <EditorIndex Value="6"/> 350 <WindowIndex Value="0"/> 351 <TopLine Value="82"/> 352 <CursorPos X="46" Y="93"/> 353 <UsageCount Value="65"/> 353 354 <Loaded Value="True"/> 354 355 </Unit35> … … 358 359 <EditorIndex Value="0"/> 359 360 <WindowIndex Value="0"/> 360 <TopLine Value=" 127"/>361 <CursorPos X="5 1" Y="143"/>362 <UsageCount Value="4 0"/>361 <TopLine Value="42"/> 362 <CursorPos X="53" Y="55"/> 363 <UsageCount Value="41"/> 363 364 <Loaded Value="True"/> 364 365 </Unit36> … … 409 410 <CursorPos X="3" Y="270"/> 410 411 <UsageCount Value="34"/> 412 <DefaultSyntaxHighlighter Value="Delphi"/> 411 413 </Unit42> 412 414 <Unit43> … … 440 442 <CursorPos X="11" Y="971"/> 441 443 <UsageCount Value="8"/> 444 <DefaultSyntaxHighlighter Value="Delphi"/> 442 445 </Unit46> 443 446 <Unit47> … … 460 463 <Filename Value="../Units/GenericBitmap.pas"/> 461 464 <UnitName Value="GenericBitmap"/> 462 <WindowIndex Value="0"/> 463 <TopLine Value="1"/> 464 <CursorPos X="15" Y="14"/> 465 <EditorIndex Value="7"/> 466 <WindowIndex Value="0"/> 467 <TopLine Value="6"/> 468 <CursorPos X="14" Y="19"/> 465 469 <UsageCount Value="32"/> 470 <Loaded Value="True"/> 466 471 </Unit49> 467 472 <Unit50> … … 472 477 <CursorPos X="22" Y="1165"/> 473 478 <UsageCount Value="28"/> 479 <DefaultSyntaxHighlighter Value="Delphi"/> 474 480 </Unit50> 475 481 <Unit51> … … 479 485 <CursorPos X="22" Y="314"/> 480 486 <UsageCount Value="28"/> 487 <DefaultSyntaxHighlighter Value="Delphi"/> 481 488 </Unit51> 482 489 <Unit52> … … 486 493 <CursorPos X="3" Y="46"/> 487 494 <UsageCount Value="28"/> 495 <DefaultSyntaxHighlighter Value="Delphi"/> 488 496 </Unit52> 489 497 <Unit53> … … 494 502 <CursorPos X="15" Y="360"/> 495 503 <UsageCount Value="28"/> 504 <DefaultSyntaxHighlighter Value="Delphi"/> 496 505 </Unit53> 497 506 <Unit54> … … 501 510 <CursorPos X="3" Y="310"/> 502 511 <UsageCount Value="28"/> 512 <DefaultSyntaxHighlighter Value="Delphi"/> 503 513 </Unit54> 504 514 <Unit55> … … 508 518 <CursorPos X="3" Y="63"/> 509 519 <UsageCount Value="28"/> 520 <DefaultSyntaxHighlighter Value="Delphi"/> 510 521 </Unit55> 511 522 <Unit56> … … 515 526 <CursorPos X="3" Y="152"/> 516 527 <UsageCount Value="28"/> 528 <DefaultSyntaxHighlighter Value="Delphi"/> 517 529 </Unit56> 518 530 <Unit57> … … 523 535 <CursorPos X="15" Y="166"/> 524 536 <UsageCount Value="28"/> 537 <DefaultSyntaxHighlighter Value="Delphi"/> 525 538 </Unit57> 526 539 <Unit58> … … 531 544 <CursorPos X="3" Y="2975"/> 532 545 <UsageCount Value="27"/> 546 <DefaultSyntaxHighlighter Value="Delphi"/> 533 547 </Unit58> 534 548 <Unit59> … … 538 552 <CursorPos X="3" Y="5243"/> 539 553 <UsageCount Value="27"/> 554 <DefaultSyntaxHighlighter Value="Delphi"/> 540 555 </Unit59> 541 556 <Unit60> … … 548 563 <Unit61> 549 564 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/inc/systemh.inc"/> 550 <EditorIndex Value=" 8"/>565 <EditorIndex Value="11"/> 551 566 <WindowIndex Value="0"/> 552 567 <TopLine Value="582"/> 553 568 <CursorPos X="11" Y="595"/> 554 <UsageCount Value="1 2"/>569 <UsageCount Value="13"/> 555 570 <Loaded Value="True"/> 556 571 </Unit61> … … 600 615 <Unit68> 601 616 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/objpas/sysutils/sysstrh.inc"/> 602 <EditorIndex Value=" 6"/>617 <EditorIndex Value="9"/> 603 618 <WindowIndex Value="0"/> 604 619 <TopLine Value="72"/> 605 620 <CursorPos X="10" Y="84"/> 606 <UsageCount Value="1 1"/>621 <UsageCount Value="12"/> 607 622 <Loaded Value="True"/> 608 623 </Unit68> 609 624 <Unit69> 610 625 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/objpas/classes/classesh.inc"/> 611 <EditorIndex Value=" 2"/>612 <WindowIndex Value="0"/> 613 <TopLine Value="25 7"/>626 <EditorIndex Value="3"/> 627 <WindowIndex Value="0"/> 628 <TopLine Value="258"/> 614 629 <CursorPos X="14" Y="270"/> 615 <UsageCount Value="1 1"/>630 <UsageCount Value="12"/> 616 631 <Loaded Value="True"/> 617 632 </Unit69> 618 633 <Unit70> 619 634 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/objpas/classes/stringl.inc"/> 620 <EditorIndex Value=" 4"/>635 <EditorIndex Value="5"/> 621 636 <WindowIndex Value="0"/> 622 637 <TopLine Value="736"/> 623 638 <CursorPos X="3" Y="738"/> 624 <UsageCount Value="1 1"/>639 <UsageCount Value="12"/> 625 640 <Loaded Value="True"/> 626 641 </Unit70> 627 642 <Unit71> 628 643 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/objpas/classes/lists.inc"/> 629 <EditorIndex Value=" 3"/>644 <EditorIndex Value="4"/> 630 645 <WindowIndex Value="0"/> 631 646 <TopLine Value="199"/> 632 <CursorPos X="3 " Y="205"/>633 <UsageCount Value="1 1"/>647 <CursorPos X="31" Y="207"/> 648 <UsageCount Value="12"/> 634 649 <Loaded Value="True"/> 635 650 </Unit71> 636 651 <Unit72> 637 652 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/objpas/sysutils/sysstr.inc"/> 638 <EditorIndex Value=" 7"/>653 <EditorIndex Value="10"/> 639 654 <WindowIndex Value="0"/> 640 655 <TopLine Value="181"/> 641 656 <CursorPos X="3" Y="187"/> 642 <UsageCount Value="1 1"/>657 <UsageCount Value="12"/> 643 658 <Loaded Value="True"/> 644 659 </Unit72> 645 660 <Unit73> 646 661 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/i386/i386.inc"/> 647 <EditorIndex Value="1 0"/>662 <EditorIndex Value="13"/> 648 663 <WindowIndex Value="0"/> 649 664 <TopLine Value="503"/> 650 665 <CursorPos X="9" Y="503"/> 651 <UsageCount Value="1 1"/>666 <UsageCount Value="12"/> 652 667 <Loaded Value="True"/> 653 668 </Unit73> 654 669 <Unit74> 655 670 <Filename Value="../../../../../Lazarus/1.1_2.7.1/fpc/2.7.1/source/rtl/inc/system.inc"/> 656 <EditorIndex Value=" 9"/>671 <EditorIndex Value="12"/> 657 672 <WindowIndex Value="0"/> 658 673 <TopLine Value="277"/> 659 674 <CursorPos X="14" Y="285"/> 675 <UsageCount Value="12"/> 676 <Loaded Value="True"/> 677 </Unit74> 678 <Unit75> 679 <Filename Value="../ReadMe.txt"/> 680 <EditorIndex Value="8"/> 681 <WindowIndex Value="0"/> 682 <TopLine Value="1"/> 683 <CursorPos X="27" Y="9"/> 660 684 <UsageCount Value="11"/> 661 685 <Loaded Value="True"/> 662 </Unit74> 686 <DefaultSyntaxHighlighter Value="None"/> 687 </Unit75> 688 <Unit76> 689 <Filename Value="../Units/GenericPoint.pas"/> 690 <UnitName Value="GenericPoint"/> 691 <EditorIndex Value="1"/> 692 <WindowIndex Value="0"/> 693 <TopLine Value="2"/> 694 <CursorPos X="19" Y="20"/> 695 <UsageCount Value="10"/> 696 <Loaded Value="True"/> 697 </Unit76> 663 698 </Units> 664 <JumpHistory Count="30" HistoryIndex="2 9">699 <JumpHistory Count="30" HistoryIndex="28"> 665 700 <Position1> 666 <Filename Value=" UMainForm.pas"/>667 <Caret Line=" 657" Column="1" TopLine="652"/>701 <Filename Value="../Units/GenericList.pas"/> 702 <Caret Line="221" Column="1" TopLine="200"/> 668 703 </Position1> 669 704 <Position2> 670 705 <Filename Value="../Units/GenericList.pas"/> 671 <Caret Line="2 37" Column="1" TopLine="229"/>706 <Caret Line="216" Column="1" TopLine="200"/> 672 707 </Position2> 673 708 <Position3> 674 709 <Filename Value="../Units/GenericList.pas"/> 675 <Caret Line=" 239" Column="1" TopLine="229"/>710 <Caret Line="308" Column="1" TopLine="295"/> 676 711 </Position3> 677 712 <Position4> 678 <Filename Value=" UMainForm.pas"/>679 <Caret Line=" 658" Column="1" TopLine="652"/>713 <Filename Value="../Units/GenericList.pas"/> 714 <Caret Line="309" Column="1" TopLine="295"/> 680 715 </Position4> 681 716 <Position5> 682 <Filename Value=" UMainForm.pas"/>683 <Caret Line=" 657" Column="1" TopLine="652"/>717 <Filename Value="../Units/GenericList.pas"/> 718 <Caret Line="313" Column="1" TopLine="295"/> 684 719 </Position5> 685 720 <Position6> 686 721 <Filename Value="../Units/GenericList.pas"/> 687 <Caret Line=" 238" Column="1" TopLine="229"/>722 <Caret Line="314" Column="1" TopLine="295"/> 688 723 </Position6> 689 724 <Position7> 690 725 <Filename Value="../Units/GenericList.pas"/> 691 <Caret Line="2 39" Column="1" TopLine="229"/>726 <Caret Line="213" Column="1" TopLine="200"/> 692 727 </Position7> 693 728 <Position8> 694 729 <Filename Value="../Units/GenericList.pas"/> 695 <Caret Line=" 521" Column="1" TopLine="508"/>730 <Caret Line="313" Column="1" TopLine="300"/> 696 731 </Position8> 697 732 <Position9> 698 733 <Filename Value="../Units/GenericList.pas"/> 699 <Caret Line=" 522" Column="1" TopLine="508"/>734 <Caret Line="314" Column="1" TopLine="300"/> 700 735 </Position9> 701 736 <Position10> 702 737 <Filename Value="../Units/GenericList.pas"/> 703 <Caret Line="2 38" Column="1" TopLine="225"/>738 <Caret Line="215" Column="1" TopLine="202"/> 704 739 </Position10> 705 740 <Position11> 706 741 <Filename Value="../Units/GenericList.pas"/> 707 <Caret Line="2 39" Column="1" TopLine="225"/>742 <Caret Line="220" Column="1" TopLine="202"/> 708 743 </Position11> 709 744 <Position12> 710 745 <Filename Value="../Units/GenericList.pas"/> 711 <Caret Line=" 187" Column="1" TopLine="174"/>746 <Caret Line="221" Column="1" TopLine="202"/> 712 747 </Position12> 713 748 <Position13> 714 749 <Filename Value="../Units/GenericList.pas"/> 715 <Caret Line="2 38" Column="1" TopLine="225"/>750 <Caret Line="216" Column="1" TopLine="202"/> 716 751 </Position13> 717 752 <Position14> 718 753 <Filename Value="../Units/GenericList.pas"/> 719 <Caret Line=" 239" Column="1" TopLine="225"/>754 <Caret Line="308" Column="1" TopLine="295"/> 720 755 </Position14> 721 756 <Position15> 722 757 <Filename Value="../Units/GenericList.pas"/> 723 <Caret Line=" 189" Column="1" TopLine="176"/>758 <Caret Line="303" Column="13" TopLine="296"/> 724 759 </Position15> 725 760 <Position16> 726 761 <Filename Value="../Units/GenericList.pas"/> 727 <Caret Line=" 190" Column="1" TopLine="176"/>762 <Caret Line="626" Column="1" TopLine="613"/> 728 763 </Position16> 729 764 <Position17> 730 <Filename Value=" ../Units/GenericList.pas"/>731 <Caret Line=" 233" Column="1" TopLine="220"/>765 <Filename Value="UMainForm.pas"/> 766 <Caret Line="657" Column="1" TopLine="653"/> 732 767 </Position17> 733 768 <Position18> 734 <Filename Value="../Units/Generic List.pas"/>735 <Caret Line=" 234" Column="1" TopLine="220"/>769 <Filename Value="../Units/GenericMatrix.pas"/> 770 <Caret Line="137" Column="19" TopLine="127"/> 736 771 </Position18> 737 772 <Position19> 738 <Filename Value="../Units/Generic List.pas"/>739 <Caret Line=" 238" Column="1" TopLine="220"/>773 <Filename Value="../Units/GenericMatrix.pas"/> 774 <Caret Line="116" Column="17" TopLine="99"/> 740 775 </Position19> 741 776 <Position20> 742 <Filename Value="../Units/Generic List.pas"/>743 <Caret Line=" 239" Column="1" TopLine="220"/>777 <Filename Value="../Units/GenericMatrix.pas"/> 778 <Caret Line="51" Column="39" TopLine="36"/> 744 779 </Position20> 745 780 <Position21> 746 <Filename Value="../Units/Generic List.pas"/>747 <Caret Line=" 187" Column="1" TopLine="174"/>781 <Filename Value="../Units/GenericMatrix.pas"/> 782 <Caret Line="66" Column="13" TopLine="56"/> 748 783 </Position21> 749 784 <Position22> 750 <Filename Value="../Units/Generic List.pas"/>751 <Caret Line=" 238" Column="1" TopLine="225"/>785 <Filename Value="../Units/GenericMatrix.pas"/> 786 <Caret Line="50" Column="3" TopLine="37"/> 752 787 </Position22> 753 788 <Position23> 754 <Filename Value="../Units/Generic List.pas"/>755 <Caret Line=" 239" Column="1" TopLine="225"/>789 <Filename Value="../Units/GenericMatrix.pas"/> 790 <Caret Line="55" Column="22" TopLine="42"/> 756 791 </Position23> 757 792 <Position24> 758 <Filename Value="../Units/Generic List.pas"/>759 <Caret Line=" 189" Column="1" TopLine="176"/>793 <Filename Value="../Units/GenericMatrix.pas"/> 794 <Caret Line="51" Column="25" TopLine="38"/> 760 795 </Position24> 761 796 <Position25> 762 <Filename Value="../Units/Generic List.pas"/>763 <Caret Line=" 190" Column="1" TopLine="176"/>797 <Filename Value="../Units/GenericMatrix.pas"/> 798 <Caret Line="53" Column="39" TopLine="38"/> 764 799 </Position25> 765 800 <Position26> 766 <Filename Value="../Units/Generic List.pas"/>767 <Caret Line=" 233" Column="1" TopLine="220"/>801 <Filename Value="../Units/GenericMatrix.pas"/> 802 <Caret Line="51" Column="39" TopLine="38"/> 768 803 </Position26> 769 804 <Position27> 770 <Filename Value="../Units/Generic List.pas"/>771 <Caret Line=" 234" Column="1" TopLine="220"/>805 <Filename Value="../Units/GenericMatrix.pas"/> 806 <Caret Line="52" Column="7" TopLine="38"/> 772 807 </Position27> 773 808 <Position28> 774 <Filename Value="../Units/Generic List.pas"/>775 <Caret Line=" 238" Column="1" TopLine="220"/>809 <Filename Value="../Units/GenericMatrix.pas"/> 810 <Caret Line="55" Column="52" TopLine="42"/> 776 811 </Position28> 777 812 <Position29> 778 813 <Filename Value="../Units/GenericList.pas"/> 779 <Caret Line=" 239" Column="1" TopLine="220"/>814 <Caret Line="93" Column="25" TopLine="82"/> 780 815 </Position29> 781 816 <Position30> 782 <Filename Value=" UMainForm.pas"/>783 <Caret Line=" 657" Column="11" TopLine="652"/>817 <Filename Value="../Units/GenericList.pas"/> 818 <Caret Line="1077" Column="4" TopLine="1052"/> 784 819 </Position30> 785 820 </JumpHistory> -
Generics/NativeGenerics/NativeGenerics.lpk
r425 r458 27 27 <Description Value="Native generics library. 28 28 Require FPC 2.7.1"/> 29 <License Value="GNU/GPL "/>29 <License Value="GNU/GPLv3"/> 30 30 <Version Minor="2"/> 31 31 <Files Count="15"> -
Generics/NativeGenerics/ReadMe.txt
r132 r458 1 Native generics 2 ================= 1 Native generics library 2 ======================= 3 3 4 4 Tutorial and basic information: 5 5 http://wiki.freepascal.org/Generics 6 6 7 Version: 0. 18 Release date: 201 1-01-207 Version: 0.2 8 Release date: 2012-09-25 9 9 Author: Chronos 10 10 Email: robie@centrum.cz … … 15 15 16 16 17 Require FPC version 2. 5.1 and newer17 Require FPC version 2.7.1 and newer 18 18 -
Generics/NativeGenerics/Units/GenericList.pas
r425 r458 95 95 function Get(Index: TIndex): TItem; override; 96 96 function GetInternal(Index: TIndex): TItem; override; 97 function GetCount: TIndex; override; 97 98 function GetCapacity: TIndex; 98 function GetCount: TIndex; override;99 procedure SetCount(const AValue: TIndex); override; 99 100 procedure SetCapacity(const AValue: TIndex); 100 101 procedure SetCapacityOptimized(const NewCapacity: TIndex); 101 procedure SetCount(const AValue: TIndex); override;102 102 procedure Put(Index: TIndex; const AValue: TItem); override; 103 103 procedure PutInternal(Index: TIndex; const AValue: TItem); override; … … 141 141 TGFileList<TItem> = class(TGList<TItem>) 142 142 private 143 FFileName: string; 143 144 FHandle: THandle; 145 FMode: Word; 146 function GetOpenned: Boolean; 147 procedure SetFileName(AValue: string); 148 procedure SetMode(AValue: Word); 144 149 protected 145 150 function GetCount: TIndex; override; … … 150 155 procedure Put(Index: TIndex; const AValue: TItem); override; 151 156 public 152 procedure Open (FileName: string; Mode: Integer);157 procedure Open; 153 158 procedure Close; 154 159 constructor Create; 155 160 destructor Destroy; override; 161 property FileName: string read FFileName write SetFileName; 162 property Mode: Word read FMode write SetMode; 163 property Openned: Boolean read GetOpenned; 156 164 end; 157 165 … … 865 873 { TGFileList<TItem> } 866 874 875 procedure TGFileList<TItem>.SetFileName(AValue: string); 876 begin 877 if FFileName = AValue then Exit; 878 FFileName := AValue; 879 if Openned then begin 880 Close; 881 Open; 882 end; 883 end; 884 885 function TGFileList<TItem>.GetOpenned: Boolean; 886 begin 887 Result := FHandle <> feInvalidHandle; 888 end; 889 890 procedure TGFileList<TItem>.SetMode(AValue: Word); 891 begin 892 if FMode = AValue then Exit; 893 FMode := AValue; 894 if Openned then begin 895 Close; 896 Open; 897 end; 898 end; 899 867 900 function TGFileList<TItem>.GetCount: TIndex; 868 901 var … … 901 934 end; 902 935 903 procedure TGFileList<TItem>.Open (FileName: string; Mode: Integer);936 procedure TGFileList<TItem>.Open; 904 937 begin 905 938 Close;
Note:
See TracChangeset
for help on using the changeset viewer.