Changeset 360


Ignore:
Timestamp:
May 7, 2012, 10:32:41 AM (13 years ago)
Author:
chronos
Message:
 
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • Common/Common.pas

    r343 r360  
    99uses
    1010  StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading,
    11   UMemory, UResetableThread, UPool, ULastOpenedList, URegistry,
     11  UMemory, UResetableThread, UPool, ULastOpenedList, URegistry, 
    1212  LazarusPackageIntf;
    1313
  • Common/UCommon.pas

    r358 r360  
    4949function SplitString(var Text: string; Count: Word): string;
    5050function GetBit(Variable: QWord; Index: Byte): Boolean;
    51 procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean);
    52 procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean);
    53 procedure SetBit(var Variable: Word; Index: Byte; State: Boolean);
     51procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload;
     52procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload;
     53procedure SetBit(var Variable: Word; Index: Byte; State: Boolean); overload;
    5454function AddLeadingZeroes(const aNumber, Length : integer) : string;
    5555function LastPos(const SubStr: String; const S: String): Integer;
     
    413413procedure OpenFileInShell(FileName: string);
    414414begin
    415   ExecuteProgram('cmd.exe /c start ' + FileName);
     415  ExecuteProgram('cmd.exe /c start "' + FileName + '"');
    416416end;
    417417
  • CoolAudio/Systems/UAudioSystem.pas

    r353 r360  
    322322  NewItem.Name := Name;
    323323  NewItem.SystemClass := SystemClass;
     324  NewItem.Supported := True;
    324325  Systems.Add(NewItem);
    325326end;
  • CoolStreaming/UStreamHelper.pas

    r307 r360  
    66
    77uses
    8   Classes, DateUtils, syncobjs;
     8  Classes, DateUtils, syncobjs, SysUtils;
    99
    1010type
     
    4949    procedure ReadStream(AStream: TStream; Count: Integer);
    5050    procedure ReadStreamPart(AStream: TStream; Count: Integer);
     51    function EqualTo(Source: TStream): Boolean;
    5152    function Sum: Byte;
    5253    procedure FillByte(Data: Byte; Count: Integer);
     
    159160end;
    160161
     162function TStreamHelper.EqualTo(Source: TStream): Boolean;
     163const
     164  BlockSize = 4096;
     165var
     166  Buffer1: array[0..BlockSize - 1] of Byte;
     167  Buffer2: array[0..BlockSize - 1] of Byte;
     168  BufferLength: Integer;
     169  OldPos1, OldPos2: Integer;
     170begin
     171  OldPos1 := Source.Position;
     172  Source.Position := 0;
     173  OldPos2 := Position;
     174  Position := 0;
     175  Result := True;
     176  if Source.Size = Size then begin
     177    while Source.Position < Source.Size do begin
     178      BufferLength := Source.Read(Buffer1, BlockSize);
     179      Read(Buffer2, BlockSize);
     180      if not CompareMem(@Buffer1, @Buffer2, BufferLength) then begin
     181        Result := False;
     182        Break;
     183      end;
     184    end;
     185  end else Result := False;
     186  Source.Position := OldPos1;
     187  Position := OldPos2;
     188end;
     189
    161190procedure TStreamHelper.WriteStreamPart(AStream: TStream; Count: Integer);
    162191var
  • Generics/TemplateGenerics/Generic/GenericRectangle.inc

    r342 r360  
    3939  procedure UnionWith(Rect: TGRectangle);
    4040
     41  procedure SetRect(Left, Top, Width, Height: TGRectangleDimension);
     42  procedure SetBounds(Left, Top, Right, Bottom: TGRectangleDimension);
     43
    4144  property Left: TGRectangleDimension read FLeft write SetLeft;
    4245  property Top: TGRectangleDimension read FTop write SetTop;
     
    246249end;
    247250
     251procedure TGRectangle.SetRect(Left, Top, Width, Height: TGRectangleDimension);
     252begin
     253  Self.Left := Left;
     254  Self.Top := Top;
     255  Self.Width := Width;
     256  Self.Height := Height;
     257end;
     258
     259procedure TGRectangle.SetBounds(Left, Top, Right, Bottom: TGRectangleDimension);
     260begin
     261  Self.Left := Left;
     262  Self.Top := Top;
     263  Self.Right := Right;
     264  Self.Bottom := Bottom;
     265end;
     266
    248267function TGRectangle.GetEmpty: Boolean;
    249268begin
Note: See TracChangeset for help on using the changeset viewer.