Changeset 204 for trunk/Packages


Ignore:
Timestamp:
May 6, 2019, 2:49:33 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Use fgl unit instead of TemplateGenerics.
  • Modified: Update czech translation.
  • Modified: Updated packages.
Location:
trunk/Packages
Files:
3 added
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Common.lpk

    r181 r204  
    6060      <Item5>
    6161        <Filename Value="UPrefixMultiplier.pas"/>
     62        <HasRegisterProc Value="True"/>
    6263        <UnitName Value="UPrefixMultiplier"/>
    6364      </Item5>
     
    144145      <EnableI18NForLFM Value="True"/>
    145146    </i18n>
    146     <RequiredPkgs Count="3">
     147    <RequiredPkgs Count="2">
    147148      <Item1>
    148149        <PackageName Value="LCL"/>
    149150      </Item1>
    150151      <Item2>
    151         <PackageName Value="TemplateGenerics"/>
    152       </Item2>
    153       <Item3>
    154152        <PackageName Value="FCL"/>
    155153        <MinVersion Major="1" Valid="True"/>
    156       </Item3>
     154      </Item2>
    157155    </RequiredPkgs>
    158156    <UsageOptions>
  • trunk/Packages/Common/Common.pas

    r181 r204  
    2020begin
    2121  RegisterUnit('UDebugLog', @UDebugLog.Register);
     22  RegisterUnit('UPrefixMultiplier', @UPrefixMultiplier.Register);
    2223  RegisterUnit('ULastOpenedList', @ULastOpenedList.Register);
    2324  RegisterUnit('UJobProgressView', @UJobProgressView.Register);
  • trunk/Packages/Common/Languages/UJobProgressView.cs.po

    r200 r204  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.8.8\n"
     12"X-Generator: Poedit 2.2\n"
    1313
    1414#: ujobprogressview.sestimatedtime
     
    2424msgstr "Dokončené"
    2525
    26 #: ujobprogressview.soperations
    27 msgid "Operations:"
    28 msgstr ""
    29 
    3026#: ujobprogressview.spleasewait
    3127msgid "Please wait..."
  • trunk/Packages/Common/Languages/UJobProgressView.po

    r200 r204  
    1414msgstr ""
    1515
    16 #: ujobprogressview.soperations
    17 msgid "Operations:"
    18 msgstr ""
    19 
    2016#: ujobprogressview.spleasewait
    2117msgid "Please wait..."
  • trunk/Packages/Common/UCommon.pas

    r200 r204  
    2828    unfDNSDomainName = 11);
    2929
    30   TFilterMethodMethod = function (FileName: string): Boolean of object;
     30  TFilterMethod = function (FileName: string): Boolean of object;
     31  TFileNameMethod = procedure (FileName: string) of object;
     32
    3133var
    3234  ExceptionHandler: TExceptionEvent;
     
    7476procedure SaveStringToFile(S, FileName: string);
    7577procedure SearchFiles(AList: TStrings; Dir: string;
    76   FilterMethod: TFilterMethodMethod = nil);
     78  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
    7779function GetStringPart(var Text: string; Separator: string): string;
    7880function StripTags(const S: string): string;
     
    8183function PosFromIndexReverse(SubStr: string; Text: string;
    8284  StartIndex: Integer): Integer;
     85procedure CopyStringArray(Dest: TStringArray; Source: array of string);
    8386
    8487
     
    108111  I: Integer;
    109112begin
     113  Result := '';
    110114  for I := 1 to Length(Source) do begin
    111115    Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2));
     
    543547
    544548procedure SearchFiles(AList: TStrings; Dir: string;
    545   FilterMethod: TFilterMethodMethod = nil);
     549  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
    546550var
    547551  SR: TSearchRec;
     
    553557        if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or
    554558          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue;
     559        if Assigned(FileNameMethod) then
     560          FileNameMethod(Dir + SR.Name);
    555561        AList.Add(Dir + SR.Name);
    556562        if (SR.Attr and faDirectory) <> 0 then
     
    654660end;
    655661
     662procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     663var
     664  I: Integer;
     665begin
     666  SetLength(Dest, Length(Source));
     667  for I := 0 to Length(Dest) - 1 do
     668    Dest[I] := Source[I];
     669end;
     670
    656671
    657672initialization
  • trunk/Packages/Common/UDebugLog.pas

    r181 r204  
    66
    77uses
    8   Classes, SysUtils, FileUtil, SpecializedList, SyncObjs;
     8  Classes, SysUtils, FileUtil, fgl, SyncObjs;
    99
    1010type
     
    2929    procedure SetMaxCount(const AValue: Integer);
    3030  public
    31     Items: TListObject;
     31    Items: TFPGObjectList<TDebugLogItem>;
    3232    Lock: TCriticalSection;
    3333    procedure Add(Text: string; Group: string = '');
     
    117117begin
    118118  inherited;
    119   Items := TListObject.Create;
     119  Items := TFPGObjectList<TDebugLogItem>.Create;
    120120  Lock := TCriticalSection.Create;
    121121  MaxCount := 100;
  • trunk/Packages/Common/UJobProgressView.lfm

    r200 r204  
    1515  OnShow = FormShow
    1616  Position = poScreenCenter
    17   LCLVersion = '1.8.2.0'
     17  LCLVersion = '2.0.2.0'
    1818  object PanelOperationsTitle: TPanel
    1919    Left = 0
     
    241241    Interval = 100
    242242    OnTimer = TimerUpdateTimer
    243     left = 264
     243    left = 320
    244244    top = 8
    245245  end
  • trunk/Packages/Common/UJobProgressView.pas

    r200 r204  
    175175  STotalEstimatedTime = 'Total estimated time: %s';
    176176  SFinished = 'Finished';
    177   SOperations = 'Operations:';
    178177
    179178procedure Register;
  • trunk/Packages/Common/UListViewSort.pas

    r181 r204  
    99uses
    1010  {$IFDEF Windows}Windows, CommCtrl, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils,
    11   Controls, DateUtils, Dialogs, SpecializedList, Forms, Grids, StdCtrls, ExtCtrls,
     11  Controls, DateUtils, Dialogs, fgl, Forms, Grids, StdCtrls, ExtCtrls,
    1212  LclIntf, LMessages, LclType, LResources;
    1313
     
    5252    {$ENDIF}
    5353  public
    54     List: TListObject;
    55     Source: TListObject;
     54    List: TFPGObjectList<TObject>;
     55    Source: TFPGObjectList<TObject>;
    5656    constructor Create(AOwner: TComponent); override;
    5757    destructor Destroy; override;
     
    9898  end;
    9999
     100  { TListViewEx }
     101
     102  TListViewEx = class(TWinControl)
     103  private
     104    FFilter: TListViewFilter;
     105    FListView: TListView;
     106    FListViewSort: TListViewSort;
     107    procedure ResizeHanlder;
     108  public
     109    constructor Create(TheOwner: TComponent); override;
     110    destructor Destroy; override;
     111  published
     112    property ListView: TListView read FListView write FListView;
     113    property ListViewSort: TListViewSort read FListViewSort write FListViewSort;
     114    property Filter: TListViewFilter read FFilter write FFilter;
     115    property Visible;
     116  end;
     117
    100118procedure Register;
    101119
     
    105123procedure Register;
    106124begin
    107   RegisterComponents('Common', [TListViewSort, TListViewFilter]);
     125  RegisterComponents('Common', [TListViewSort, TListViewFilter, TListViewEx]);
     126end;
     127
     128{ TListViewEx }
     129
     130procedure TListViewEx.ResizeHanlder;
     131begin
     132end;
     133
     134constructor TListViewEx.Create(TheOwner: TComponent);
     135begin
     136  inherited Create(TheOwner);
     137  Filter := TListViewFilter.Create(Self);
     138  Filter.Parent := Self;
     139  Filter.Align := alBottom;
     140  ListView := TListView.Create(Self);
     141  ListView.Parent := Self;
     142  ListView.Align := alClient;
     143  ListViewSort := TListViewSort.Create(Self);
     144  ListViewSort.ListView := ListView;
     145end;
     146
     147destructor TListViewEx.Destroy;
     148begin
     149  inherited Destroy;
    108150end;
    109151
     
    277319end;
    278320
     321var
     322  ListViewSortCompare: TCompareEvent;
     323
     324function ListViewCompare(const Item1, Item2: TObject): Integer;
     325begin
     326  Result := ListViewSortCompare(Item1, Item2);
     327end;
     328
    279329procedure TListViewSort.Sort(Compare: TCompareEvent);
    280330begin
     331  // TODO: Because TFLGObjectList compare handler is not class method,
     332  // it is necessary to use simple function compare handler with local variable
     333  ListViewSortCompare := Compare;
    281334  if (List.Count > 0) then
    282     List.Sort(Compare);
     335    List.Sort(ListViewCompare);
    283336end;
    284337
     
    343396begin
    344397  inherited;
    345   List := TListObject.Create;
    346   List.OwnsObjects := False;
     398  List := TFPGObjectList<TObject>.Create;
     399  List.FreeObjects := False;
    347400end;
    348401
  • trunk/Packages/Common/UMemory.pas

    r200 r204  
    112112procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory);
    113113begin
    114   Move(Memory.FData, PByte(@FData + Position)^, Memory.Size);
     114  Move(Memory.FData, PByte(PByte(@FData) + Position)^, Memory.Size);
    115115end;
    116116
    117117procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory);
    118118begin
    119   Move(PByte(@FData + Position)^, Memory.FData, Memory.Size);
     119  Move(PByte(PByte(@FData) + Position)^, Memory.FData, Memory.Size);
    120120end;
    121121
  • trunk/Packages/Common/UPool.pas

    r3 r204  
    66
    77uses
    8   Classes, SysUtils, syncobjs, SpecializedList, UThreading;
     8  Classes, SysUtils, syncobjs, fgl, UThreading;
    99
    1010type
     
    2222    function NewItemObject: TObject; virtual;
    2323  public
    24     Items: TListObject;
    25     FreeItems: TListObject;
     24    Items: TFPGObjectList<TObject>;
     25    FreeItems: TFPGObjectList<TObject>;
    2626    function Acquire: TObject; virtual;
    2727    procedure Release(Item: TObject); virtual;
     
    185185begin
    186186  inherited;
    187   Items := TListObject.Create;
    188   FreeItems := TListObject.Create;
    189   FreeItems.OwnsObjects := False;
     187  Items := TFPGObjectList<TObject>.Create;
     188  FreeItems := TFPGObjectList<TObject>.Create;
     189  FreeItems.FreeObjects := False;
    190190  FReleaseEvent := TEvent.Create(nil, False, False, '');
    191191end;
  • trunk/Packages/Common/UPrefixMultiplier.pas

    r3 r204  
    2121  { TPrefixMultiplier }
    2222
    23   TPrefixMultiplier = class
     23  TPrefixMultiplier = class(TComponent)
    2424  private
    25     function TruncateDigits(Value:Double;Digits:Integer=3):Double;
     25    function TruncateDigits(Value: Double; Digits: Integer = 3): Double;
    2626  public
    2727    function Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef;
     
    7272  );
    7373
     74procedure Register;
     75
     76
    7477implementation
     78
     79procedure Register;
     80begin
     81  RegisterComponents('Common', [TPrefixMultiplier]);
     82end;
    7583
    7684{ TPrefixMultiplier }
     
    92100end;
    93101
    94 function TPrefixMultiplier.Add(Value:Double;PrefixMultipliers:TPrefixMultiplierDef
    95   ;UnitText:string;Digits:Integer):string;
     102function TPrefixMultiplier.Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef
     103  ; UnitText:string; Digits: Integer): string;
    96104var
    97105  I: Integer;
  • trunk/Packages/Common/URegistry.pas

    r169 r204  
    2929    procedure SetCurrentContext(AValue: TRegistryContext);
    3030  public
     31    function ReadChar(const Name: string): Char;
     32    procedure WriteChar(const Name: string; Value: Char);
    3133    function ReadBoolWithDefault(const Name: string;
    3234      DefaultValue: Boolean): Boolean;
    3335    function ReadIntegerWithDefault(const Name: string; DefaultValue: Integer): Integer;
    3436    function ReadStringWithDefault(const Name: string; DefaultValue: string): string;
     37    function ReadCharWithDefault(const Name: string; DefaultValue: Char): Char;
    3538    function ReadFloatWithDefault(const Name: string;
    3639      DefaultValue: Double): Double;
     
    8992end;
    9093
     94function TRegistryEx.ReadCharWithDefault(const Name: string; DefaultValue: Char
     95  ): Char;
     96begin
     97  if ValueExists(Name) then Result := ReadChar(Name)
     98    else begin
     99      WriteChar(Name, DefaultValue);
     100      Result := DefaultValue;
     101    end;
     102end;
     103
    91104function TRegistryEx.ReadFloatWithDefault(const Name: string;
    92105  DefaultValue: Double): Double;
     
    137150end;
    138151
     152function TRegistryEx.ReadChar(const Name: string): Char;
     153var
     154  S: string;
     155begin
     156  S := ReadString(Name);
     157  if Length(S) > 0 then Result := S[1]
     158    else Result := #0;
     159end;
     160
     161procedure TRegistryEx.WriteChar(const Name: string; Value: Char);
     162begin
     163  WriteString(Name, Value);
     164end;
     165
    139166function TRegistryEx.ReadBoolWithDefault(const Name: string;
    140167  DefaultValue: Boolean): Boolean;
  • trunk/Packages/CoolTranslator/UCoolTranslator.pas

    r203 r204  
    200200  PropInfo: PPropInfo;
    201201  PropList: PPropList;
    202   Excludes: TComponentExcludes;
    203202begin
    204203  Count := GetTypeData(Component.ClassInfo)^.PropCount;
     
    253252          if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then
    254253          //if not IsExcluded(Component, PropInfo^.Name) then
    255               SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo)));
     254              SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, string(GetWideStrProp(Component, PropInfo))));
    256255        end;
    257256        tkClass: begin
     
    415414        Lang := ParamStr(i + 1);
    416415  end;
    417   if Lang = '' then
     416  if Lang = '' then begin
     417    T := '';
    418418    LazGetLanguageIDs(Lang, T);
     419  end;
    419420
    420421  if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin
     
    432433function TCoolTranslator.FindLocaleFileName(LCExt: string): string;
    433434var
    434   T: string;
    435435  Lang: string;
    436436begin
  • trunk/Packages/TemplateGenerics/Generic/GenericMatrix.inc

    r3 r204  
    2323    function GetItem(Index: TIndex): TGMatrixItem;
    2424    function GetCapacity: TIndex;
    25     function GetLast: TGMatrixItem;
    26     function GetFirst: TGMatrixItem;
    2725    procedure SetCapacity(const AValue: TIndex);
    28     procedure SetLast(AValue: TGMatrixItem);
    29     procedure SetFirst(AValue: TGMatrixItem);
    3026    procedure PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); virtual;
    3127    procedure PutItem(Index: TIndex; const AValue: TGMatrixItem); virtual;
    3228    procedure SetCount(const AValue: TIndex);
    3329  public
    34     function Add(Item: TGMatrixItem): TIndex;
    35     procedure AddMatrix(Values: array of TRow);
    36     procedure AddList(List: TGMatrix);
    3730    procedure Assign(Source: TGMatrix);
    3831    procedure Clear; virtual;
    3932    procedure Contract;
    4033    function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex;
    41     procedure Delete(Index: TIndex); virtual;
    42     procedure DeleteItems(Index, Count: TIndex);
    43     function EqualTo(List: TGMatrix): Boolean;
    4434    procedure Expand;
    45     function Extract(Item: TGMatrixItem): TGMatrixItem;
    4635    procedure Exchange(Index1, Index2: TIndex);
    47     property First: TGMatrixItem read GetFirst write SetFirst;
    4836    procedure FillAll(Value: TGMatrixItem);
    4937    procedure Fill(Start, Count: TIndex; Value: TGMatrixItem);
    5038    function Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string;
    51     procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    52     function IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex;
    53     function IndexOfList(List: TGMatrix; Start: TIndex): TIndex;
    54     procedure Insert(Index: TIndex; Item: TGMatrixItem);
    55     procedure InsertList(Index: TIndex; List: TGMatrix);
    56     procedure InsertArray(Index: TIndex; Values: array of TGMatrixItem);
    57     procedure Move(CurIndex, NewIndex: TIndex);
    58     procedure MoveItems(CurIndex, NewIndex, Count: TIndex);
    5939    procedure Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge);
    6040    procedure Replace(Index: TIndex; Source: TGMatrix);
    61     function Remove(Item: TGMatrixItem): TIndex;
    6241    procedure Reverse;
    6342    procedure ReverseHorizontal;
    6443    procedure ReverseVertical;
    65     procedure Sort(Compare: TSortCompare);
    66     procedure SetArray(Values: array of TGMatrixItem);
    6744    property Count: TIndex read FCount write SetCount;
    6845    property Capacity: TIndex read GetCapacity write SetCapacity;
     
    7148    property Items[Index: TIndex]: TGMatrixItem
    7249      read GetItem write PutItem;
    73     property Last: TGMatrixItem read GetLast write SetLast;
    7450  end;
    7551
     
    7854
    7955{$IFDEF IMPLEMENTATION_USES}
    80 
    81 uses
    82   RtlConsts;
    8356
    8457resourcestring
     
    137110
    138111procedure TGMatrix.SetCapacity(const AValue: TIndex);
    139 var
    140   Y: TGMatrixIndexY;
    141112begin
    142113  if (Capacity.X <> AValue.X) and (Capacity.Y <> AValue.Y) then begin
    143 (*    SetLength(FItems, AValue.Y);
    144     Y := 0;
    145     while Y < Length(FItems) do begin
    146       SetLength(FItems[Y], AValue.X);
    147       Y := Y + 1;
    148     end;
    149   end;
    150   *)
    151114    SetLength(FItems, AValue.Y, AValue.X);
    152115  end;
     
    244207end;
    245208
    246 function TGMatrix.Extract(Item: TGMatrixItem): TGMatrixItem;
    247 var
    248   I: TIndex;
    249 begin
    250 (*  I := IndexOf(Item);
    251   if I >= 0 then begin
    252     Result := Item;
    253     Delete(I);
    254   end else
    255     raise EListError.CreateFmt(SListIndexError, [0]);
    256     *)
    257 end;
    258 
    259 function TGMatrix.IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex;
    260 begin
    261 (*  Result := Start;
    262   while (Result < FCount) and
    263   not CompareMem(Addr(FItems[Result]), Addr(Item), SizeOf(TGMatrixItem)) do
    264     Result := Result + 1;
    265   if Result = FCount then Result := -1;
    266   *)
    267 end;
    268 
    269 procedure TGMatrix.Insert(Index: TIndex; Item: TGMatrixItem);
    270 begin
    271 (*  if (Index < 0) or (Index > FCount ) then
    272     raise EListError.CreateFmt(SListIndexError, [Index]);
    273   if FCount = Capacity then Expand;
    274   if Index < FCount then
    275     System.Move(FItems[Index], FItems[Index + 1], (FCount - Index) * SizeOf(TGMatrixItem));
    276   FItems[Index] := Item;
    277   FCount := FCount + 1;
    278   *)
    279 end;
    280 
    281 procedure TGMatrix.InsertList(Index: TIndex; List: TGMatrix);
    282 var
    283   I: TIndex;
    284 begin
    285 (*  I := 0;
    286   while (I < List.Count) do begin
    287     Insert(Index + I, List[I]);
    288     I := I + 1;
    289   end;
    290   *)
    291 end;
    292 
    293 function TGMatrix.IndexOfList(List: TGMatrix; Start: TIndex): TIndex;
    294 var
    295   I: TIndex;
    296 begin
    297 (*  if List.Count > 0 then begin
    298     Result := IndexOf(List[0], Start);
    299     if Result <> -1 then begin
    300       I := 1;
    301       while I < List.Count do begin
    302         if not CompareMem(Addr(FItems[Result + I]), Addr(List.FItems[I]), SizeOf(TGMatrixItem)) then begin
    303           Result := -1;
    304           Break;
    305         end;
    306         I := I + 1;
    307       end;
    308     end;
    309   end else Result := -1;
    310   *)
    311 end;
    312 
    313 function TGMatrix.GetLast: TGMatrixItem;
    314 begin
    315 (*  if FCount = 0 then
    316     raise EListError.CreateFmt(SListIndexError, [0])
    317   else
    318     Result := Items[FCount - 1];
    319     *)
    320 end;
    321 
    322 procedure TGMatrix.SetLast(AValue: TGMatrixItem);
    323 begin
    324 (*  if FCount = 0 then
    325     raise EListError.CreateFmt(SListIndexError, [0])
    326   else
    327     Items[FCount - 1] := AValue;
    328     *)
    329 end;
    330 
    331 function TGMatrix.GetFirst: TGMatrixItem;
    332 begin
    333 (*  if FCount = 0 then
    334     raise EListError.CreateFmt(SListIndexError, [0])
    335   else
    336     Result := Items[0];
    337     *)
    338 end;
    339 
    340 procedure TGMatrix.SetFirst(AValue: TGMatrixItem);
    341 begin
    342 (*  if FCount = 0 then
    343     raise EListError.CreateFmt(SListIndexError, [0])
    344   else
    345     Items[0] := AValue;
    346     *)
    347 end;
    348 
    349 procedure TGMatrix.Move(CurIndex, NewIndex: TIndex);
    350 var
    351   Temp: TGMatrixItem;
    352 begin
    353 (*  if ((CurIndex < 0) or (CurIndex > Count - 1)) then
    354     raise EListError.CreateFmt(SListIndexError, [CurIndex]);
    355   if ((NewIndex < 0) or (NewIndex > Count -1)) then
    356     raise EListError.CreateFmt(SlistIndexError, [NewIndex]);
    357   Temp := FItems[CurIndex];
    358   if NewIndex > CurIndex then begin
    359     System.Move(FItems[CurIndex + 1], FItems[CurIndex], (NewIndex - CurIndex) * SizeOf(TGMatrixItem));
    360   end else
    361   if NewIndex < CurIndex then begin
    362     System.Move(FItems[NewIndex], FItems[NewIndex + 1], (CurIndex - NewIndex) * SizeOf(TGMatrixItem));
    363   end;
    364   FItems[NewIndex] := Temp;
    365   //Delete(CurIndex);
    366   //Insert(NewIndex, Temp);*)
    367 end;
    368 
    369 procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: TIndex);
    370 var
    371   S: Integer;
    372   D: Integer;
    373 begin
    374 (*  if CurIndex < NewIndex then begin
    375     S := CurIndex + Count - 1;
    376     D := NewIndex + Count - 1;
    377     while S >= CurIndex do begin
    378       Move(S, D);
    379       S := S - 1;
    380       D := D - 1;
    381     end;
    382   end else
    383   if CurIndex > NewIndex then begin
    384     S := CurIndex;
    385     D := NewIndex;
    386     while S < (CurIndex + Count) do begin
    387       Move(S, D);
    388       S := S + 1;
    389       D := D + 1;
    390     end;
    391   end;*)
    392 end;
    393 
    394 function TGMatrix.Remove(Item: TGMatrixItem): TIndex;
    395 begin
    396 (*  Result := IndexOf(Item);
    397   if Result <> -1 then
    398     Delete(Result); *)
    399 end;
    400 
    401 function TGMatrix.EqualTo(List: TGMatrix): Boolean;
    402 var
    403   I: TIndex;
    404 begin
    405 (*  Result := Count = List.Count;
    406   if Result then begin
    407     I := 0;
    408     while I < Count do begin
    409       if not CompareMem(Addr(FItems[I]), Addr(List.FItems[I]), SizeOf(TGMatrixItem)) then begin
    410         Result := False;
    411         Break;
    412       end;
    413       I := I + 1;
    414     end;
    415   end; *)
    416 end;
    417 
    418209procedure TGMatrix.Reverse;
    419210var
     
    464255end;
    465256
    466 procedure TGMatrix.Sort(Compare: TSortCompare);
    467 begin
    468 (*  if FCount > 1 then
    469     QuickSort(0, FCount - 1, Compare); *)
    470 end;
    471 
    472 procedure TGMatrix.AddMatrix(Values: array of TRow);
    473 var
    474   I: TIndex;
    475 begin
    476 (*  I := 0;
    477   while I <= High(Values) do begin
    478     Add(Values[I]);
    479     I := I + 1;
    480   end; *)
    481 end;
    482 
    483 procedure TGMatrix.SetArray(Values: array of TGMatrixItem);
    484 var
    485   I: TIndex;
    486 begin
    487 (*  Clear;
    488   I := 0;
    489   while I <= High(Values) do begin
    490     Add(Values[I]);
    491     I := I + 1;
    492   end; *)
    493 end;
    494 
    495 procedure TGMatrix.InsertArray(Index: TIndex; Values: array of TGMatrixItem);
    496 var
    497   I: TIndex;
    498 begin
    499 (*  I := 0;
    500   while I <= High(Values) do begin
    501     Insert(Index + I, Values[I]);
    502     I := I + 1;
    503   end; *)
    504 end;
    505 
    506257function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string;
    507258var
     
    525276end;
    526277
    527 procedure TGMatrix.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    528 begin
    529 (*  Clear;
    530   while (Pos(Separator, Text) > 0) and
    531   ((Count < (SlicesCount - 1)) or (SlicesCount = -1)) do begin
    532     Add(Converter(Copy(Text, 1, Pos(Separator, Text) - 1)));
    533     System.Delete(Text, 1, Pos(Separator, Text) + Length(Separator) - 1);
    534   end;
    535   Add(Converter(Text)); *)
    536 end;
    537 
    538 function TGMatrix.Add(Item: TGMatrixItem): TIndex;
    539 begin
    540 (*  if FCount = Capacity then
    541     Self.Expand;
    542   FItems[FCount] := Item;
    543   Result := FCount;
    544   FCount := FCount + 1; *)
    545 end;
    546 
    547 procedure TGMatrix.AddList(List: TGMatrix);
    548 var
    549   I: TIndex;
    550 begin
    551 (*  I := 0;
    552   while I < List.Count do begin
    553     Add(List[I]);
    554     I := I + 1;
    555   end; *)
    556 end;
    557 
    558278procedure TGMatrix.Clear;
    559279begin
    560280  Count := CreateIndex(0, 0);
    561281  Capacity := CreateIndex(0, 0);
    562 end;
    563 
    564 procedure TGMatrix.Delete(Index: TIndex);
    565 begin
    566 (*  if (Index < 0) or (Index >= FCount) then
    567     raise EListError.CreateFmt(SListIndexError, [Index]);
    568   FCount := FCount - 1;
    569   System.Move(FItems[Index + 1], FItems[Index], (FCount - Index) * SizeOf(TGMatrixItem));
    570   Contract;
    571   *)
    572 end;
    573 
    574 procedure TGMatrix.DeleteItems(Index, Count: TIndex);
    575 var
    576   I: TIndex;
    577 begin
    578 (*  I := Index;
    579   while I < (Index + Count) do begin
    580     Delete(Index);
    581     I := I + 1;
    582   end;
    583   *)
    584282end;
    585283
  • trunk/Packages/TemplateGenerics/Specialized/SpecializedStream.pas

    r3 r204  
    113113function TMemoryStreamByte.WriteBuffer(var Buffer; Count: Integer): Integer;
    114114begin
    115 
     115  Result := 0;
    116116end;
    117117
     
    137137function TMemoryStreamByte.ReadBuffer(var Buffer; Count: Integer): Integer;
    138138begin
    139 
     139  Result := 0;
    140140end;
    141141
     
    143143  ): Integer;
    144144begin
    145 
     145  Result := 0;
    146146end;
    147147
Note: See TracChangeset for help on using the changeset viewer.