Changeset 290


Ignore:
Timestamp:
Nov 4, 2011, 11:42:45 AM (13 years ago)
Author:
george
Message:
  • Added: Unit UMemory for manipulation with memory block. Unit contains simple class TPositionMemory for storing position with memory block and mimic behaviour of TMemoryStream.
  • Fixed: Deleting files with special national characters.
Location:
Common
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • Common/Common.lpk

    r267 r290  
    2222    <License Value="GNU/GPL"/>
    2323    <Version Minor="3"/>
    24     <Files Count="7">
     24    <Files Count="8">
    2525      <Item1>
    2626        <Filename Value="StopWatch.pas"/>
     
    5252        <UnitName Value="UThreading"/>
    5353      </Item7>
     54      <Item8>
     55        <Filename Value="UMemory.pas"/>
     56        <UnitName Value="UMemory"/>
     57      </Item8>
    5458    </Files>
    5559    <i18n>
  • Common/Common.pas

    r251 r290  
    99uses
    1010  StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading,
    11   LazarusPackageIntf;
     11  UMemory, LazarusPackageIntf;
    1212
    1313implementation
  • Common/UCommon.pas

    r282 r290  
    77uses
    88  {$IFDEF Windows}Windows,{$ENDIF}
    9   Classes, SysUtils, SpecializedList, StrUtils, Dialogs, Process,
     9  Classes, SysUtils, StrUtils, Dialogs, Process,
    1010  FileUtil; //, ShFolder, ShellAPI;
    1111
     
    102102  Path := IncludeTrailingPathDelimiter(APath);
    103103
    104   Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec);
     104  Find := FindFirst(UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);
    105105  while Find = 0 do begin
    106     DeleteFile(Path + SearchRec.Name);
     106    DeleteFileUTF8(Path + UTF8Encode(SearchRec.Name));
    107107
    108108    Find := SysUtils.FindNext(SearchRec);
  • Common/UDebugLog.pas

    r267 r290  
    101101begin
    102102  try
    103     if FileExistsUTF8(FileName) then LogFile := TFileStream.Create(FileName, fmOpenWrite)
    104       else LogFile := TFileStream.Create(FileName, fmCreate);
     103    ForceDirectoriesUTF8(ExtractFileDir(FileName));
     104    if FileExistsUTF8(FileName) then LogFile := TFileStream.Create(UTF8Decode(FileName), fmOpenWrite)
     105      else LogFile := TFileStream.Create(UTF8Decode(FileName), fmCreate);
    105106    LogFile.Seek(0, soFromEnd);
    106107    Text := FormatDateTime('hh:nn:ss.zzz', Now) + ': ' + Text + LineEnding;
Note: See TracChangeset for help on using the changeset viewer.