LazUtils: Deprecate now obsolete unit LazUtf8Classes and remove its references from Lazarus code.

git-svn-id: trunk@64384 -
This commit is contained in:
juha 2021-01-14 12:41:32 +00:00
parent 9e0ae34ea4
commit 42850cfe4d
80 changed files with 363 additions and 394 deletions

View File

@ -43,7 +43,7 @@ uses
agg_trans_affine ,
agg_math_stroke ,
expat ,
FileUtil, LazUTF8Classes ;
FileUtil;
{ TYPES DEFINITION }
const
@ -659,9 +659,9 @@ end;
procedure parser.parse(fname: string);
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
fs:=TFileStreamUTF8.Create(fname,fmOpenRead+fmShareDenyWrite);
fs:=TFileStream.Create(fname,fmOpenRead+fmShareDenyWrite);
try
parse(fs);
finally

View File

@ -43,8 +43,6 @@ interface
uses
Classes, SysUtils, Laz_AVL_Tree,
// LazUtils
LazUTF8Classes,
// Codetools
FileProcs;
@ -501,12 +499,12 @@ end;
procedure TFPCMsgFile.LoadFromFile(const Filename: string);
var
sl: TStringListUTF8;
sl: TStringList;
begin
{$IFDEF VerboseFPCMsgFile}
debugln(['TFPCMsgFile.LoadFromFile START ',Filename]);
{$ENDIF}
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.LoadFromFile(Filename);
LoadFromList(sl);

View File

@ -60,7 +60,7 @@ uses
CodeToolsStructs, KeywordFuncLists, LinkScanner, FileProcs,
// LazUtils
LazStringUtils, LazFileUtils, FileUtil, LazFileCache,
LazUTF8, LazUTF8Classes, UTF8Process, LazDbgLog, AvgLvlTree, Laz2_XMLCfg;
LazUTF8, UTF8Process, LazDbgLog, AvgLvlTree, Laz2_XMLCfg;
const
ExternalMacroStart = ExprEval.ExternalMacroStart;
@ -1576,7 +1576,7 @@ function RunFPCInfo(const CompilerFilename: string;
var
Param: String;
List: TStringList;
Params: TStringListUTF8;
Params: TStringList;
begin
Result:='';
Param:='';
@ -1590,7 +1590,7 @@ begin
if Param='' then exit;
Param:='-i'+Param;
List:=nil;
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
try
Params.Add(Param);
SplitCmdLineParams(Options,Params);
@ -1867,11 +1867,11 @@ function RunFPCVerbose(const CompilerFilename, TestFilename: string; out
UnitPaths: TStrings; out IncludePaths: TStrings; out UnitScopes: TStrings;
out Defines, Undefines: TStringToStringTree; const Options: string): boolean;
var
Params: TStringListUTF8;
Params: TStringList;
Filename: String;
WorkDir: String;
List: TStringList;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
Result:=false;
ConfigFiles:=nil;
@ -1882,7 +1882,7 @@ begin
Defines:=nil;
Undefines:=nil;
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
List:=nil;
try
Params.Add('-va');
@ -1890,7 +1890,7 @@ begin
if TestFilename<>'' then begin
// create empty file
try
fs:=TFileStreamUTF8.Create(TestFilename,fmCreate);
fs:=TFileStream.Create(TestFilename,fmCreate);
fs.Free;
except
debugln(['Warning: [RunFPCVerbose] unable to create test file "'+TestFilename+'"']);
@ -2031,7 +2031,7 @@ var
S2SItem: PStringToStringItem;
CurUnitName, Filename, PkgName, FPMFilename, FPMSourcePath, Line: String;
p, EndPos, FPCTargetEndPos, i, FileCount: Integer;
sl: TStringListUTF8;
sl: TStringList;
FPM: TPCFPMFileState;
begin
// try to resolve .ppu files via fpmkinst .fpm files
@ -2082,7 +2082,7 @@ begin
FPMSourcePath:='';
if FileExistsCached(FPMFilename) then begin
//debugln(['GatherUnitsInFPMSources Found .fpm: ',FPMFilename]);
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
try
sl.LoadFromFile(FPMFilename);
@ -3417,13 +3417,13 @@ end;
procedure ReadMakefileFPC(const Filename: string; List: TStrings);
var
MakefileFPC: TStringListUTF8;
MakefileFPC: TStringList;
i: Integer;
Line: string;
p: LongInt;
NameValue: String;
begin
MakefileFPC:=TStringListUTF8.Create;
MakefileFPC:=TStringList.Create;
MakefileFPC.LoadFromFile(Filename);
i:=0;
while i<MakefileFPC.Count do begin
@ -3954,7 +3954,7 @@ function IsCompilerExecutable(AFilename: string; out ErrorMsg: string; out
Kind: TPascalCompiler; Run: boolean): boolean;
var
ShortFilename, Line: String;
Params: TStringListUTF8;
Params: TStringList;
Lines: TStringList;
i: Integer;
begin
@ -3987,7 +3987,7 @@ begin
if Run then begin
// run it and check for magics
debugln(['Note: (lazarus) [IsCompilerExecutable] run "',AFilename,'"']);
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
Lines:=nil;
try
Params.Add('-va');
@ -6325,7 +6325,7 @@ var
SrcOS: string;
SrcOS2: String;
Step: String;
Params: TStringListUTF8;
Params: TStringList;
begin
Result:=nil;
//DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',CompilerPath,'" FPCOptions="',CompilerOptions,'"');
@ -6343,7 +6343,7 @@ begin
SetLength(Buf,1024);
Step:='Init';
try
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
TheProcess := TProcessUTF8.Create(nil);
try
TheProcess.Executable:=CompilerPath;
@ -6393,7 +6393,7 @@ begin
//DebugLn('TDefinePool.CreateFPCTemplate First done UnitSearchPath="',UnitSearchPath,'"');
// ask for target operating system -> ask compiler with switch -iTO
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
TheProcess := TProcessUTF8.Create(nil);
try
TheProcess.Executable:=CompilerPath;
@ -6445,7 +6445,7 @@ begin
end;
// ask for target processor -> ask compiler with switch -iTP
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
TheProcess := TProcessUTF8.Create(nil);
try
TheProcess.Executable:=CompilerPath;
@ -7875,7 +7875,7 @@ begin
UnitPath:='';
IncPath:='';
Namespaces:='';
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
try
SplitCmdLineParams(CmdLine,Params);
for i:=0 to Params.Count-1 do begin

View File

@ -44,8 +44,7 @@ uses
// CodeTools
CodeToolsStrConsts,
// LazUtils
LazUtilities, LazLoggerBase, LazFileCache, LazFileUtils, LazUTF8, LazUTF8Classes,
LazStringUtils;
LazUtilities, LazLoggerBase, LazFileCache, LazFileUtils, LazUTF8, LazStringUtils;
type
TFPCStreamSeekType = int64;
@ -394,12 +393,12 @@ end;
-------------------------------------------------------------------------------}
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
if FileExistsUTF8(Filename) then begin
try
InvalidateFileStateCache(Filename);
fs:=TFileStreamUTF8.Create(Filename,fmOpenWrite);
fs:=TFileStream.Create(Filename,fmOpenWrite);
fs.Size:=0;
fs.Free;
except

View File

@ -34,7 +34,7 @@ unit PPUParser;
interface
uses
Classes, SysUtils, contnrs, FileProcs, LazFileUtils, lazutf8classes;
Classes, SysUtils, contnrs, FileProcs, LazFileUtils;
const
PPUIsEndianBig = {$IFDEF ENDIAN_BIG}True{$ELSE}False{$ENDIF};
@ -2621,9 +2621,9 @@ end;
procedure TPPU.LoadFromFile(const Filename: string; const Parts: TPPUParts);
var
ms: TMemoryStream;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead or fmShareDenyWrite);
fs:=TFileStream.Create(Filename,fmOpenRead or fmShareDenyWrite);
ms:=TMemoryStream.Create;
try
ms.Size:=fs.Size;

View File

@ -38,7 +38,7 @@ uses
{$ENDIF}
Classes, SysUtils,
// LazUtils
LazFileUtils, LazUTF8, LazUTF8Classes, LazDbgLog, LazStringUtils;
LazFileUtils, LazUTF8, LazDbgLog, LazStringUtils;
type
TSourceLog = class;
@ -745,13 +745,13 @@ end;
function TSourceLog.LoadFromFile(const Filename: string): boolean;
var
s: string;
fs: TFileStreamUTF8;
fs: TFileStream;
p: Integer;
begin
Result := False;
LastError:='';
try
fs := TFileStreamUTF8.Create(Filename, fmOpenRead or fmShareDenyNone);
fs := TFileStream.Create(Filename, fmOpenRead or fmShareDenyNone);
try
SetLength(s, fs.Size);
if s <> '' then
@ -801,7 +801,7 @@ end;
function TSourceLog.SaveToFile(const Filename: string): boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
s: String;
begin
{$IFDEF VerboseCTSave}
@ -821,11 +821,11 @@ begin
// keep filename case on disk
if FileExistsUTF8(Filename) then begin
InvalidateFileStateCache(Filename);
fs := TFileStreamUTF8.Create(Filename, fmOpenWrite or fmShareDenyNone);
fs := TFileStream.Create(Filename, fmOpenWrite or fmShareDenyNone);
fs.Size := 0;
end else begin
InvalidateFileStateCache; // invalidate all (samba shares)
fs := TFileStreamUTF8.Create(Filename, fmCreate);
fs := TFileStream.Create(Filename, fmCreate);
end;
try
if s <> '' then

View File

@ -13,7 +13,7 @@ uses
{$endif}
fgl, lazfglhash,
fpDbgSymTable,
Classes, SysUtils, LazUTF8Classes, DbgIntfBaseTypes, contnrs,
Classes, SysUtils, DbgIntfBaseTypes, contnrs,
FpDbgCommon;
type
@ -225,7 +225,7 @@ begin
end;
{$ENDIF}
FFileName := AFileName;
FStream := TFileStreamUTF8.Create(AFileName, fmOpenRead or fmShareDenyNone);
FStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone);
inherited Create;
{$endif}
end;
@ -292,7 +292,7 @@ begin
if AMem = nil then
exit;
if FStream = nil then
FStream := TFileStreamUTF8.Create(FFileName, fmOpenRead or fmShareDenyNone);
FStream := TFileStream.Create(FFileName, fmOpenRead or fmShareDenyNone);
FStream.Position := AOffset;
Result := FStream.Read(AMem^, ASize);
{$endif}
@ -309,7 +309,7 @@ begin
if AMem = nil then
exit;
if FStream = nil then
FStream := TFileStreamUTF8.Create(FFileName, fmOpenRead or fmShareDenyNone);
FStream := TFileStream.Create(FFileName, fmOpenRead or fmShareDenyNone);
FList.Add(AMem);
FStream.Position := AOffset;
Result := FStream.Read(AMem^, ASize);

View File

@ -27,7 +27,7 @@ uses
// LCL
LCLProc, LResources, Forms, Controls, Dialogs, XMLPropStorage,
// LazUtils
LazConfigStorage, FileUtil, LazFileUtils, LazFileCache, LazUTF8Classes,
LazConfigStorage, FileUtil, LazFileUtils, LazFileCache,
// CodeTools
CodeAtom, CodeTree, KeywordFuncLists, NonPascalCodeTools, BasicCodeTools,
FileProcs, CodeCache, SourceChanger, CodeToolManager,
@ -1028,7 +1028,7 @@ begin
FCIncludesValid:=true;
//DebugLn(['TH2PasFile.ReadCIncludes Filename="',Filename,'"']);
try
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.LoadFromFile(Filename);
for i:=0 to sl.Count-1 do begin
@ -2241,7 +2241,7 @@ begin
DebugLn(['TH2PasConverter.MergeIncludeFiles merging file '
,'"'+IncludeFile.Filename+'"'+' into "'+TextConverter.Filename+'"']);
try
fs:=TFileStreamUTF8.Create(IncludeFile.Filename,fmOpenRead);
fs:=TFileStream.Create(IncludeFile.Filename,fmOpenRead);
try
SetLength(s,fs.Size);
if s<>'' then begin

View File

@ -25,7 +25,7 @@ uses
// LCL
LCLProc,
// LazUtils
UITypes, FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, LazLoggerBase,
UITypes, FileUtil, LazFileUtils, LazUTF8, LazLoggerBase,
// IdeIntf
SrcEditorIntf, PropEdits, ObjInspStrConsts;
@ -419,7 +419,7 @@ begin
end;
tctFile:
if FileExistsUTF8(FFilename) then begin
fs:=TFileStreamUTF8.Create(FFilename,fmOpenRead);
fs:=TFileStream.Create(FFilename,fmOpenRead);
try
SetLength(FSource,fs.Size);
fs.Read(FSource[1],length(FSource));
@ -451,10 +451,7 @@ begin
end;
tctFile:
if FileExistsUTF8(FFilename) then begin
if FStrings is TStringListUTF8 then
FStrings.LoadFromFile(FFilename)
else
FStrings.LoadFromFile(UTF8ToSys(FFilename));
FStrings.LoadFromFile(FFilename);
ResetFile;
end;
tctCodeBuffer:
@ -477,7 +474,7 @@ begin
case FCurrentType of
tctSource:
begin
fs:=TFileStreamUTF8.Create(FFilename,fmCreate);
fs:=TFileStream.Create(FFilename,fmCreate);
try
if FSource<>'' then begin
fs.Write(FSource[1],length(FSource));
@ -489,10 +486,7 @@ begin
end;
tctStrings:
if FStrings<>nil then begin
if FStrings is TStringListUTF8 then
FStrings.LoadFromFile(FFilename)
else
FStrings.LoadFromFile(UTF8ToSys(FFilename));
FStrings.LoadFromFile(FFilename);
ResetStrings;
end;
tctCodeBuffer:
@ -554,7 +548,7 @@ begin
RenameFileUTF8(FFilename,TrimmedFilename);
tctSource:
begin
fs:=TFileStreamUTF8.Create(TrimmedFilename,fmCreate);
fs:=TFileStream.Create(TrimmedFilename,fmCreate);
try
if FSource<>'' then
fs.Write(FSource[1],length(FSource));
@ -564,10 +558,7 @@ begin
end;
tctStrings:
begin
if FStrings is TStringListUTF8 then
FStrings.SaveToFile(TrimmedFilename)
else
FStrings.SaveToFile(UTF8ToSys(TrimmedFilename));
FStrings.SaveToFile(TrimmedFilename);
ResetStrings;
end;
tctCodeBuffer:
@ -699,7 +690,7 @@ begin
case CurrentType of
tctSource:
begin
fs:=TFileStreamUTF8.Create(AFilename,fmOpenRead);
fs:=TFileStream.Create(AFilename,fmOpenRead);
try
SetLength(FSource,fs.Size);
if fSource<>'' then
@ -711,10 +702,7 @@ begin
tctFile:
CopyFile(AFilename,FFilename);
tctStrings:
if FStrings is TStringListUTF8 then
FStrings.LoadFromFile(FFilename)
else
FStrings.LoadFromFile(UTF8ToSys(FFilename));
FStrings.LoadFromFile(FFilename)
end;
Result:=true;
except

View File

@ -12,7 +12,7 @@ unit LR_e_img;
interface
uses
Classes, SysUtils, LR_Class, Graphics, LazUtf8Classes
Classes, SysUtils, LR_Class, Graphics
{$IFDEF LCLNOGUI}
, FPImage, FPWriteBMP, FPWritePNG, FPWriteJPEG
{$ENDIF}
@ -55,7 +55,7 @@ implementation
constructor TfrImageExportFilter.Create(AStream: TStream);
begin
inherited Create(AStream);
FFileName := TFileStreamUtf8(AStream).FileName;
FFileName := TFileStream(AStream).FileName;
FFileExt := LowerCase(ExtractFileExt(FFileName));
FFileName := ChangeFileExt(FFileName, '');
FZoom := 1;

View File

@ -39,7 +39,12 @@ unit le_e_spreadsheet;
interface
uses
Classes, SysUtils, LR_ExportMatrix, LR_Class, LR_BarC, fpspreadsheet, Graphics, le_e_spreadsheet_types;
Classes, SysUtils, Math,
// LazUtils + LCL
LazFileUtils, LCLType, LCLIntf, Forms, Controls, Graphics,
LR_ExportMatrix, LR_Class, LR_BarC, fpspreadsheet, le_e_spreadsheet_types,
le_e_spreadsheet_params, fpsTypes, fpsutils, fpsAllFormats,
le_e_spreadsheet_consts, lrSpreadSheetExp, fpsPageLayout;
type
@ -103,9 +108,6 @@ type
end;
implementation
uses LCLType, le_e_spreadsheet_params, fpsTypes, fpsutils, fpsAllFormats,
LazUTF8Classes, Forms, Controls, LCLIntf, LazFileUtils, le_e_spreadsheet_consts,
lrSpreadSheetExp, math, fpsPageLayout;
const
ssAligns : array [TAlignment] of TsHorAlignment = (haLeft, haRight, haCenter);
@ -500,8 +502,8 @@ begin
FExportMatrix.MergeCell:=FMergeCell;
FExportMatrix.DeleteEmptyRow:=FDeleteEmptyRow;
if AStream is TFileStreamUTF8 then
FFileName := TFileStreamUTF8(AStream).FileName
if AStream is TFileStream then
FFileName := TFileStream(AStream).FileName
else
FFileName := '';
end;

View File

@ -20,7 +20,7 @@ uses
Controls, Forms, Dialogs, Menus, Graphics, LCLProc, LCLType, LCLIntf,
Printers, osPrinters,
// LazUtils
LazFileUtils, LazUTF8, LazUTF8Classes,
LazFileUtils, LazUTF8,
// IDEIntf
PropEdits,
// LazReport
@ -10682,7 +10682,7 @@ end;
procedure TfrReport.LoadFromFile(const FName: String);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
Ext : String;
begin
Ext:=ExtractFileExt(fName);
@ -10691,7 +10691,7 @@ begin
else
begin
CheckFileExists(fName);
Stream := TFileStreamUtf8.Create(FName, fmOpenRead);
Stream := TFileStream.Create(FName, fmOpenRead);
LoadFromStream(Stream);
Stream.Free;
FileName := FName;
@ -10729,7 +10729,7 @@ end;
procedure TfrReport.SaveToFile(FName: String);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
Ext : string;
begin
Ext:=ExtractFileExt(fName);
@ -10743,7 +10743,7 @@ begin
SaveToXMLFile(fName)
else
begin
Stream := TFileStreamUtf8.Create(FName, fmCreate);
Stream := TFileStream.Create(FName, fmCreate);
SaveToStream(Stream);
Stream.Free;
end;
@ -10855,9 +10855,9 @@ end;
procedure TfrReport.LoadPreparedReport(const FName: String);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
begin
Stream := TFileStreamUtf8.Create(FName, fmOpenRead);
Stream := TFileStream.Create(FName, fmOpenRead);
EMFPages.LoadFromStream(Stream);
Stream.Free;
CanRebuild := False;
@ -10865,9 +10865,9 @@ end;
procedure TfrReport.SavePreparedReport(const FName: String);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
begin
Stream := TFileStreamUtf8.Create(FName, fmCreate);
Stream := TFileStream.Create(FName, fmCreate);
if not CanRebuild and not (roDontUpgradePreparedReport in Options) then
EMFPages.UpgradeToCurrentVersion;
EMFPages.SaveToStream(Stream);
@ -10877,7 +10877,7 @@ end;
procedure TfrReport.LoadTemplate(const fname: String; comm: TStrings;
Bmp: TBitmap; Load: Boolean);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
b: Byte;
fb: TBitmap;
fm: TStringList;
@ -10885,7 +10885,7 @@ var
begin
fb := TBitmap.Create;
fm := TStringList.Create;
Stream := TFileStreamUtf8.Create(FName, fmOpenRead);
Stream := TFileStream.Create(FName, fmOpenRead);
if Load then
begin
ReadMemo(Stream, fm);
@ -10945,14 +10945,13 @@ begin
end;
end;
procedure TfrReport.SaveTemplate(const fname: String; comm: TStrings;
Bmp: TBitmap);
procedure TfrReport.SaveTemplate(const fname: String; comm: TStrings; Bmp: TBitmap);
var
Stream: TFileStreamUtf8;
Stream: TFileStream;
b: Byte;
pos, lpos: Integer;
begin
Stream := TFileStreamUtf8.Create(FName, fmCreate);
Stream := TFileStream.Create(FName, fmCreate);
frWriteMemo(Stream, Comm);
b := 0;
pos := Stream.Position;
@ -11217,7 +11216,7 @@ begin
end;
var
ExportStream: TFileStreamUtf8;
ExportStream: TFileStream;
procedure TfrReport.ExportBeforeModal(Sender: TObject);
var
@ -11247,7 +11246,7 @@ begin
if Trim(aFilename) = '' then
raise Exception.create(sNoValidExportFilenameWasSupplied);
ExportStream := TFileStreamUtf8.Create(aFileName, fmCreate);
ExportStream := TFileStream.Create(aFileName, fmCreate);
result := ExportTo(FilterClass, exportStream, true);
if result then
begin

View File

@ -26,7 +26,7 @@ unit laz2_XMLRead;
interface
uses
SysUtils, Classes, laz2_DOM, lazutf8classes;
SysUtils, Classes, laz2_DOM;
type
TErrorSeverity = (esWarning, esError, esFatal);
@ -4183,7 +4183,7 @@ var
FileStream: TStream;
begin
ADoc := nil;
FileStream := TFileStreamUTF8.Create(AFilename, fmOpenRead+fmShareDenyWrite);
FileStream := TFileStream.Create(AFilename, fmOpenRead+fmShareDenyWrite);
try
ReadXMLFile(ADoc, FileStream, FilenameToURI(AFilename), Flags);
finally
@ -4257,7 +4257,7 @@ procedure ReadXMLFragment(AParentNode: TDOMNode; const AFilename: String;
var
Stream: TStream;
begin
Stream := TFileStreamUTF8.Create(AFilename, fmOpenRead+fmShareDenyWrite);
Stream := TFileStream.Create(AFilename, fmOpenRead+fmShareDenyWrite);
try
ReadXMLFragment(AParentNode, Stream, FilenameToURI(AFilename), Flags);
finally
@ -4331,7 +4331,7 @@ var
Stream: TStream;
begin
ADoc := nil;
Stream := TFileStreamUTF8.Create(AFilename, fmOpenRead+fmShareDenyWrite);
Stream := TFileStream.Create(AFilename, fmOpenRead+fmShareDenyWrite);
try
ReadDTDFile(ADoc, Stream, FilenameToURI(AFilename));
finally

View File

@ -25,7 +25,7 @@ unit laz2_XMLWrite;
interface
uses Classes, LazUTF8, laz2_DOM, SysUtils, laz2_xmlutils, lazutf8classes;
uses Classes, LazUTF8, laz2_DOM, SysUtils, laz2_xmlutils;
type
TXMLWriterFlag = (
@ -866,9 +866,9 @@ end;
procedure WriteXMLFile(doc: TXMLDocument; const AFileName: String;
Flags: TXMLWriterFlags = []);
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
fs := TFileStreamUTF8.Create(AFileName, fmCreate);
fs := TFileStream.Create(AFileName, fmCreate);
try
WriteXMLFile(doc, fs, Flags);
finally

View File

@ -29,7 +29,7 @@ type
public
procedure LoadFromFile(const FileName: string); override;
procedure SaveToFile(const FileName: string); override;
end;
end deprecated 'Use TStringList instead';
{ TMemoryStreamUTF8 }
@ -37,18 +37,16 @@ type
public
procedure LoadFromFile(const FileName: string);
procedure SaveToFile(const FileName: string);
end;
end deprecated 'Use TMemoryStream instead';
procedure LoadStringsFromFileUTF8(List: TStrings; const FileName: string);
deprecated 'Just use TStrings.LoadFromFile';
procedure SaveStringsToFileUTF8(List: TStrings; const FileName: string);
deprecated 'Just use TStrings.SaveToFile';
function CompareStringListItemsUTF8LowerCase(List: TStringList; Index1, Index2: Integer): Integer;
implementation
uses
LazFileUtils; //avoid circular reference with LazFileUtils
procedure LoadStringsFromFileUTF8(List: TStrings; const FileName: string);
var
uList: TStringListUTF8;
@ -85,12 +83,6 @@ begin
end;
end;
function CompareStringListItemsUTF8LowerCase(List: TStringList; Index1,
Index2: Integer): Integer;
begin
Result:=CompareStr(UTF8LowerCase(List[Index1]),UTF8LowerCase(List[Index2]));
end;
{ TMemoryStreamUTF8 }
procedure TMemoryStreamUTF8.LoadFromFile(const FileName: string);

View File

@ -29,7 +29,7 @@ interface
uses
Classes, SysUtils,
// LazUtils
LazUtf8Classes, LazUtilsStrConsts;
LazUtilsStrConsts;
type
{ TTextStrings }
@ -846,9 +846,9 @@ end;
procedure TTextStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -858,9 +858,9 @@ end;
procedure TTextStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -65,7 +65,7 @@ uses
Classes, SysUtils,
{$IF FPC_FULLVERSION>=30001}jsonscanner,{$ENDIF} jsonparser, fpjson,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, LConvEncoding, LazLoggerBase,
FileUtil, LazFileUtils, LazUTF8, LConvEncoding, LazLoggerBase,
AvgLvlTree, StringHashList;
type
@ -509,7 +509,7 @@ end;
function UpdatePOFile(RSTFiles: TStrings; const POFilename: string): boolean;
var
InputLines: TStringListUTF8;
InputLines: TStringList;
Filename: string;
BasePoFile: TPoFile;
i: Integer;
@ -526,7 +526,7 @@ begin
exit;
end;
InputLines := TStringListUTF8.Create;
InputLines := TStringList.Create;
try
// Read base po items
if FileExistsUTF8(POFilename) then
@ -735,7 +735,7 @@ var
f: TStream;
begin
FPoName := AFilename;
f := TFileStreamUTF8.Create(AFilename, fmOpenRead or fmShareDenyNone);
f := TFileStream.Create(AFilename, fmOpenRead or fmShareDenyNone);
try
Create(f, Full);
if FHeader=nil then
@ -1483,9 +1483,9 @@ end;
procedure TPOFile.SaveToFile(const AFilename: string);
var
OutLst: TStringListUTF8;
OutLst: TStringList;
begin
OutLst := TStringListUTF8.Create;
OutLst := TStringList.Create;
try
SaveToStrings(OutLst);
OutLst.SaveToFile(AFilename);

View File

@ -15,7 +15,7 @@ unit MacApplicationRes;
interface
uses
Classes, SysUtils, LazUTF8Classes, LazFileUtils;
Classes, SysUtils, LazFileUtils;
type
EMacResourceException = Exception;
@ -43,13 +43,13 @@ procedure CreateMacOSXApplicationResources(const Filename,
procedure WriteInfoPlistFile(const Directory: string);
var
sl: TStringListUTF8;
sl: TStringList;
ExeName: String;
PLInfoListFilename: String;
begin
ExeName:=ExtractFileName(Filename);
PLInfoListFilename:=Directory+'Info.plist';
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.Add('<?xml version="1.0" encoding="UTF-8"?>');
sl.Add('<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">');
@ -97,11 +97,11 @@ procedure CreateMacOSXApplicationResources(const Filename,
procedure WritePkgInfoFile(const Directory: string);
var
sl: TStringListUTF8;
sl: TStringList;
PkgInfoFilename: String;
begin
PkgInfoFilename:=Directory+'PkgInfo';
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.Add('APPL????');
sl.SaveToFile(PkgInfoFilename);
@ -112,11 +112,11 @@ procedure CreateMacOSXApplicationResources(const Filename,
procedure WriteREADMErtfFile(const Directory, Title, Description: string);
var
sl: TStringListUTF8;
sl: TStringList;
ReadmeFilename: String;
begin
ReadmeFilename:=Directory+'README.rtf';
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.Add('{\rtf1\mac\ansicpg10000\cocoartf102');
sl.Add('{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;}');
@ -171,8 +171,7 @@ begin
end;
end;
function GetMacOSXExecutableFilename(const BaseDir, ShortExeName: string
): string;
function GetMacOSXExecutableFilename(const BaseDir, ShortExeName: string): string;
begin
Result:=AppendPathDelim(BaseDir)+ShortExeName+'.app'+PathDelim
+'Contents'+PathDelim+'MacOS'+ShortExeName;

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, IniFiles,
// LazUtils
FileUtil, LazFileUtils, LazUTF8Classes,
FileUtil, LazFileUtils,
// ProjectTemplates
ptstrconst;
@ -285,12 +285,12 @@ end;
procedure TProjectTemplate.InitFromDir(const DirName: String);
Var
L : TStringListUTF8;
L : TStringList;
FN : String;
begin
FDirectory:=IncludeTrailingPathDelimiter(DirName);
L:=TStringListUTF8.Create;
L:=TStringList.Create;
Try
FN:=FDirectory+'project.ini';
If FileExistsUTF8(FN) then
@ -397,7 +397,7 @@ end;
procedure TProjectTemplate.CopyAndSubstituteFile(Const SrcFN,DestFN : String; Values : Tstrings);
Var
L : TStringListUTF8;
L : TStringList;
begin
If pos(ExtractFileExt(SrcFN)+',',Exclude)<>0 then
@ -407,7 +407,7 @@ begin
end
else
begin
L:=TStringListUTF8.Create;
L:=TStringList.Create;
try
CreateFile(SrcFN,L,Values);
L.SaveToFile(DestFN);

View File

@ -34,7 +34,7 @@ unit SynEditLines;
interface
uses
Classes, SysUtils, FileUtil, LazUtf8Classes, FPCAdds, SynEditTextBuffer;
Classes, SysUtils, FileUtil, FPCAdds, SynEditTextBuffer;
type
@ -98,7 +98,7 @@ type
fBuffer: PChar;
fBufPtr: Cardinal;
fBufSize: Cardinal;
fFiler: TFileStreamUtf8;
fFiler: TFileStream;
procedure Flush; virtual;
procedure SetBufferSize(NewSize: Cardinal);
public
@ -168,7 +168,7 @@ type
constructor TSynEditFileReader.Create(const FileName: string);
begin
inherited Create;
fFiler := TFileStreamUtf8.Create(FileName, fmOpenRead{ ToDo: or fmShareDenyWrite});
fFiler := TFileStream.Create(FileName, fmOpenRead{ ToDo: or fmShareDenyWrite});
fFileSize := fFiler.Size;
fFiler.Seek(0, soFromBeginning);
end;
@ -261,7 +261,7 @@ type
constructor TSynEditFileWriter.Create(const FileName: string);
begin
inherited Create;
fFiler := TFileStreamUtf8.Create(FileName, fmCreate);
fFiler := TFileStream.Create(FileName, fmCreate);
fFiler.Seek(0, soFromBeginning);
end;

View File

@ -49,7 +49,7 @@ unit SynHighlighterLFM;
interface
uses
SysUtils, Classes, FileUtil, LazUTF8Classes, Graphics,
SysUtils, Classes, FileUtil, Graphics,
SynEditTypes, SynEditHighlighter, SynEditHighlighterFoldBase;
type
@ -181,7 +181,7 @@ begin
WasText := FALSE;
AStrings.Clear;
try
Src := TFileStreamUTF8.Create(AFile, fmOpenRead or fmShareDenyWrite);
Src := TFileStream.Create(AFile, fmOpenRead or fmShareDenyWrite);
try
Dest := TMemoryStream.Create;
try
@ -210,7 +210,7 @@ begin
try
AStrings.SaveToStream(Src);
Src.Seek(0, soFromBeginning);
Dest := TFileStreamUTF8.Create(AFile, fmCreate);
Dest := TFileStream.Create(AFile, fmCreate);
try
ObjectTextToResource(Src, Dest);
finally

View File

@ -41,7 +41,8 @@ unit SynMacroRecorder;
interface
uses
Classes, SysUtils, FileUtil, LazUTF8Classes, Types, LCLType, Menus,
Classes, SysUtils, Types,
FileUtil, LCLType, Menus,
SynEdit, SynEditKeyCmds, SynEditPlugins, SynEditStrConst;
type
@ -934,7 +935,7 @@ procedure TCustomSynMacroRecorder.LoadFromFile(aFilename: string);
var
F : TFileStream;
begin
F := TFileStreamUTF8.Create(aFilename, fmOpenRead);
F := TFileStream.Create(aFilename, fmOpenRead);
try
LoadFromStream(F);
MacroName := ChangeFileExt(ExtractFileName(aFilename), '');
@ -947,7 +948,7 @@ procedure TCustomSynMacroRecorder.SaveToFile(aFilename: string);
var
F : TFileStream;
begin
F := TFileStreamUTF8.Create(aFilename, fmCreate);
F := TFileStream.Create(aFilename, fmCreate);
try
SaveToStream(F);
finally

View File

@ -61,7 +61,7 @@ uses
Menus,
GraphType, ////TL Added for TFontStyles
LCLType, ////TL Added for vk_* key declarations
Classes, FileUtil, LazUTF8Classes,
Classes, FileUtil,
SysUtils,
SynEdit,
SynEditHighlighter,
@ -995,7 +995,7 @@ begin
iDlg.Filter := sUniFileDescription + ' (*.hgl)|*.hgl';
if not iDlg.Execute then
Exit;
iFile := TFileStreamUTF8.Create( iDlg.FileName, fmOpenRead or fmShareDenyWrite );
iFile := TFileStream.Create( iDlg.FileName, fmOpenRead or fmShareDenyWrite );
try
if iRange = h.MainRules then
begin

View File

@ -50,13 +50,10 @@ unit SynUniHighlighter;
interface
uses
SysUtils,
////TL Windows,
Classes, SysUtils,
Graphics,
Classes, FileUtil, LazUTF8Classes,
SynEditTypes,
GraphType, ////TL 2003-06-11: Added for TFontStyles
SynEditHighlighter;
GraphType, FileUtil,
SynEditTypes, SynEditHighlighter;
Const
_Root='Root';

View File

@ -12,8 +12,7 @@ interface
{$I SynEdit.inc}
uses
////TL DsgnIntf,
componenteditors, ////TL added
componenteditors,
Classes,
SynUniHighlighter,
SynUniDesigner,

View File

@ -131,10 +131,10 @@ type
implementation
uses
Dialogs, Controls, // FCL, RTL
StrUtils, LazUTF8Classes,
// FCL, RTL
StrUtils,
// LCL
LCLType, LclIntf, Forms, ActnList, ExtCtrls,
LCLType, LclIntf, Controls, Dialogs, Forms, ActnList, ExtCtrls,
// LazUtils
LazFileUtils, LazStringUtils, LazFileCache, LazLoggerBase, LazTracer,
// Codetools
@ -391,12 +391,12 @@ end;
class procedure TToDoListCore.ExtractToCSV(const aListItems:TListItems;const aFilename:string);
var
lCommaList: TStringListUTF8;
lCommaList: TStringList;
i: Integer;
lToDoItem: TTodoItem;
s, t: String;
begin
lCommaList:=TStringListUTF8.Create;
lCommaList:=TStringList.Create;
try
lCommaList.Add(csvHeader);
i:=0;

View File

@ -40,14 +40,10 @@ unit IpMsg;
interface
uses
LCLType,
LCLIntf,
LazFileUtils, LazUTF8Classes,
Classes,
SysUtils,
IpStrms,
IpUtils,
IpConst;
Classes, SysUtils,
LCLType, LCLIntf,
LazFileUtils,
IpStrms, IpUtils, IpConst;
type
TIpMimeEncodingMethod = (em7Bit, em8Bit, emBase64, emBinary, emBinHex,
@ -1927,7 +1923,7 @@ var
FS : TFileStream;
begin
if (FBody.Size > 0) then begin
FS := TFileStreamUTF8.Create(OutFile, fmCreate);
FS := TFileStream.Create(OutFile, fmCreate);
try
ExtractBodyStream(FS);
finally
@ -3498,7 +3494,7 @@ var
begin
EncodeMessage;
Position := 0;
FS := TFileStreamUTF8.Create(aFileName, fmCreate);
FS := TFileStream.Create(aFileName, fmCreate);
try
FS.CopyFrom(MsgStream, MsgStream.Size);
finally

View File

@ -36,7 +36,7 @@ interface
uses
SysUtils, Classes, Controls, Registry, ComCtrls,
LCLType, GraphType, LCLIntf, LMessages, LazFileUtils, lazutf8classes, LCLProc;
LCLType, GraphType, LCLIntf, LMessages, LazFileUtils, LCLProc;
const
InternetProfessionalVersion = 1.15;
@ -523,7 +523,7 @@ function InternetSumOfFile(const FileName : string) : DWORD;
var
FileSt : TFileStream;
begin
FileSt := TFileStreamUTF8.Create(FileName, CrcFileMode);
FileSt := TFileStream.Create(FileName, CrcFileMode);
try
Result := InternetSumOfStream(FileSt, 0);
finally
@ -739,9 +739,9 @@ end;
{ Calculates the MD5 Digest of a file }
function MD5SumOfFile(const FileName : string) : string;
var
FileSt : TFileStreamUTF8;
FileSt : TFileStream;
begin
FileSt := TFileStreamUTF8.Create(FileName, CrcFileMode);
FileSt := TFileStream.Create(FileName, CrcFileMode);
try
Result := MD5SumOfStream(FileSt);
finally

View File

@ -39,8 +39,7 @@ uses
// CodeTools
CodeToolManager, DefineTemplates, CodeCache, LinkScanner, FileProcs,
// LazUtils
LConvEncoding, FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, LazStringUtils,
AvgLvlTree,
LConvEncoding, FileUtil, LazFileUtils, LazUTF8, LazStringUtils, AvgLvlTree,
// IDEIntf
ComponentReg, IDEDialogs, LazIDEIntf, PackageIntf, ProjectIntf,
IDEExternToolIntf, IDEOptEditorIntf,
@ -1245,13 +1244,13 @@ end;
function TConvertDelphiProjPack.ExtractOptionsFromCFG(const CFGFilename: string): TModalResult;
var
sl: TStringListUTF8;
sl: TStringList;
i: Integer;
Line, s: string;
c: char;
begin
try
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.LoadFromFile(CFGFilename);
for i:=0 to sl.Count-1 do begin

View File

@ -36,7 +36,7 @@ uses
Classes, SysUtils, contnrs,
LCLProc, Forms, Controls, Grids, LResources, Dialogs, Buttons, StdCtrls, ExtCtrls,
// LazUtils
LazFileUtils, LazUTF8Classes, LazUTF8, AvgLvlTree,
LazFileUtils, LazUTF8, AvgLvlTree,
// components
SynHighlighterLFM, SynEdit, SynEditMiscClasses,
// codetools
@ -279,12 +279,12 @@ end;
function TDFMConverter.ConvertDfmToLfm(const aFilename: string): TModalResult;
var
DFMStream, LFMStream, Utf8LFMStream: TMemoryStreamUTF8;
DFMStream, LFMStream, Utf8LFMStream: TMemoryStream;
begin
Result:=mrOk;
DFMStream:=TMemoryStreamUTF8.Create;
LFMStream:=TMemoryStreamUTF8.Create;
Utf8LFMStream:=TMemoryStreamUTF8.Create;
DFMStream:=TMemoryStream.Create;
LFMStream:=TMemoryStream.Create;
Utf8LFMStream:=TMemoryStream.Create;
try
// Note: The file is copied from DFM file earlier. Load it.
try

View File

@ -100,8 +100,6 @@ begin
end;
{$else}
{$ifdef linux}
uses
LazUTF8Classes;
function EnumerateProcesses(AList: TRunningProcessInfoList): boolean;
@ -110,7 +108,7 @@ function EnumerateProcesses(AList: TRunningProcessInfoList): boolean;
S: TStream;
Sz: Integer;
begin
S := TFileStreamUTF8.Create('/proc/' + IntToStr(Pid) + '/cmdline', fmOpenRead or fmShareDenyNone);
S := TFileStream.Create('/proc/' + IntToStr(Pid) + '/cmdline', fmOpenRead or fmShareDenyNone);
try
SetLength(Result, 255);
Sz := S.Read(Result[1], 255);

View File

@ -27,10 +27,10 @@ interface
uses
Classes, SysUtils,
// LCL
Forms, Controls, Graphics, StdCtrls, Buttons, ExtCtrls, ComCtrls, Menus, ImgList,
Forms, Controls, Graphics, StdCtrls, Buttons, ExtCtrls, ComCtrls, Menus,
LCLIntf, LazConf, InterfaceBase, LCLPlatformDef, Clipbrd, LCLVersion,
// LazUtils
FPCAdds, LazFileUtils, lazutf8classes,
FPCAdds, LazFileUtils,
// Codetools
DefineTemplates,
// IDE
@ -277,7 +277,7 @@ begin
//debugln('TAboutForm.LoadContributors ',FileExistsUTF8(ContributorsFileName),' ',ContributorsFileName);
if FileExistsUTF8(ContributorsFileName) then
LoadStringsFromFileUTF8(Contributors.Lines,ContributorsFileName)
Contributors.Lines.LoadFromFile(ContributorsFileName)
else
Contributors.Lines.Text:=lisAboutNoContributors;
end;
@ -296,7 +296,7 @@ begin
+'docs'+PathDelim+'acknowledgements.txt';
if FileExistsUTF8(AcknowledgementsFileName) then
LoadStringsFromFileUTF8(Acknowledgements.Lines,AcknowledgementsFileName)
Acknowledgements.Lines.LoadFromFile(AcknowledgementsFileName)
else
Acknowledgements.Lines.Text:=lisAboutNoContributors;
end;

View File

@ -51,7 +51,7 @@ uses
LCLProc, Forms, Controls, LCLType, StdCtrls, ExtCtrls, Buttons, Dialogs,
LCLPlatformDef, CheckLst, Menus, ComCtrls,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazLoggerBase, lazutf8classes, LazFileCache,
FileUtil, LazFileUtils, LazUTF8, LazLoggerBase, LazFileCache,
// LazControls
DividerBevel,
// Codetools
@ -430,7 +430,7 @@ begin
IdeBuildMode:=Profile.IdeBuildMode;
EnvironmentOverrides:=TStringList.Create;
CmdLineParams:=TStringListUTF8.Create;
CmdLineParams:=TStringList.Create;
Tool:=nil;
try
// setup external tool
@ -948,7 +948,7 @@ function TLazarusBuilder.SaveIDEMakeOptions(Profile: TBuildLazarusProfile;
Flags: TBuildLazarusFlags): TModalResult;
var
Filename: String;
fs: TFileStreamUTF8;
fs: TFileStream;
OptionsAsText: String;
begin
Result:=mrCancel;
@ -960,7 +960,7 @@ begin
Filename:=GetMakeIDEConfigFilename;
try
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
try
if fExtraOptions<>'' then begin
// FPC expects console codepage for command line params

View File

@ -37,7 +37,7 @@ interface
uses
Classes, SysUtils,
// LazUtils
LazFileUtils, Laz2_XMLCfg, LazUTF8, LazUTF8Classes, LazFileCache, LazStringUtils,
LazFileUtils, Laz2_XMLCfg, LazUTF8, LazFileCache, LazStringUtils,
// LCL
LCLProc, LCLType,
// CodeTools
@ -1136,7 +1136,7 @@ end;
procedure TCodeToolsOptions.CreateDefaultIndentationFile;
var
res: TResourceStream;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
// indentations (laz_indentation.pas)
CopySecondaryConfigFile(DefaultIndentationFilename);
@ -1145,7 +1145,7 @@ begin
res := TResourceStream.Create(HInstance, PChar('indentation'), PChar(RT_RCDATA));
try
InvalidateFileStateCache;
fs := TFileStreamUTF8.Create(IndentationFilename, fmCreate);
fs := TFileStream.Create(IndentationFilename, fmCreate);
try
fs.CopyFrom(res, res.Size);
finally

View File

@ -40,7 +40,7 @@ uses
// LCL
LCLProc, LResources, Forms, Controls, Dialogs, ComCtrls,
// LazUtils
FileUtil, LazFileUtils, LazFileCache, Laz2_XMLCfg, LazUTF8Classes,
FileUtil, LazFileUtils, LazFileCache, Laz2_XMLCfg,
// CodeTools
FileProcs, CodeToolsConfig, CodeCache, CodeToolManager,
// IdeIntf
@ -298,9 +298,9 @@ function LoadStringListFromFile(const Filename, ListTitle: string;
begin
Result:=mrCancel;
if sl=nil then
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
LoadStringsFromFileUTF8(sl,Filename);
sl.LoadFromFile(Filename);
Result:=mrOk;
except
on E: Exception do begin
@ -317,7 +317,7 @@ function SaveStringListToFile(const Filename, ListTitle: string;
begin
Result:=mrCancel;
if sl=nil then
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.SaveToFile(Filename);
Result:=mrOk;
@ -401,14 +401,14 @@ function CheckCreatingFile(const AFilename: string;
CheckReadable: boolean; WarnOverwrite: boolean; CreateBackup: boolean
): TModalResult;
var
fs: TFileStreamUTF8;
fs: TFileStream;
c: char;
begin
// create if not yet done
if not FileExistsCached(AFilename) then begin
try
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(AFilename,fmCreate);
fs:=TFileStream.Create(AFilename,fmCreate);
fs.Free;
except
Result:=IDEMessageDialog(lisUnableToCreateFile,
@ -436,9 +436,9 @@ begin
try
if CheckReadable then begin
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(AFilename,fmOpenWrite or fmShareDenyNone)
fs:=TFileStream.Create(AFilename,fmOpenWrite or fmShareDenyNone)
end else
fs:=TFileStreamUTF8.Create(AFilename,fmOpenReadWrite);
fs:=TFileStream.Create(AFilename,fmOpenReadWrite);
try
fs.Position:=fs.Size;
c := ' ';
@ -454,7 +454,7 @@ begin
// check readable
try
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(AFilename,fmOpenReadWrite);
fs:=TFileStream.Create(AFilename,fmOpenReadWrite);
try
fs.Position:=fs.Size-1;
fs.Read(c,1);
@ -608,11 +608,11 @@ end;
function SaveStringToFile(const Filename, Content: string;
ErrorButtons: TMsgDlgButtons; const Context: string): TModalResult;
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
try
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
try
if Content<>'' then
fs.Write(Content[1],length(Content));

View File

@ -43,7 +43,7 @@ uses
// LCL
Forms, Controls, Buttons, StdCtrls, ExtCtrls, Dialogs, ComCtrls, LCLType,
// LazUtils
FileUtil, lazutf8classes,
FileUtil,
// SynEdit
SynEdit, SynHighlighterDiff,
// IdeIntf
@ -213,12 +213,12 @@ end;
function TSelectedDiffFile.TextContents: string;
var
dat: TStringListUTF8;
dat: TStringList;
begin
if fFile = nil then Exit('');
if fFile.Editor = nil then
begin
dat := TStringListUTF8.Create;
dat := TStringList.Create;
try
dat.LoadFromFile(fFile.Name);
Result := dat.Text;

View File

@ -35,7 +35,7 @@ uses
// CodeTools
FileProcs, CodeCache,
// LazUtils
LazUTF8Classes, LazFileUtils, UITypes,
LazFileUtils, UITypes,
// IdeIntf
IDEImagesIntf,
// SynEdit
@ -106,7 +106,7 @@ var
CodeOk: Boolean;
MemCode: TCodeBuffer;
s, DiskEncoding, MemEncoding: String;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
for i:=AnUnitList.Count-1 downto 0 do
begin
@ -114,7 +114,7 @@ begin
MemCode:=CurUnit.Source;
CodeOk:=false;
try
fs := TFileStreamUTF8.Create(MemCode.Filename, fmOpenRead or fmShareDenyNone);
fs := TFileStream.Create(MemCode.Filename, fmOpenRead or fmShareDenyNone);
try
SetLength(s{%H-}, fs.Size);
if s <> '' then
@ -150,7 +150,7 @@ var
i: Integer;
CurPackage: TLazPackage;
PackageOk: Boolean;
fs: TFileStreamUTF8;
fs: TFileStream;
CurSource, DiskSource: string;
AltFilename: String;
begin
@ -165,7 +165,7 @@ begin
continue; // lpk has vanished, an alternative lpk was found => show
try
CurPackage.SaveToString(CurSource);
fs:=TFileStreamUTF8.Create(CurPackage.Filename,fmOpenRead);
fs:=TFileStream.Create(CurPackage.Filename,fmOpenRead);
try
if fs.Size=length(CurSource) then begin
// size has not changed => load to see difference
@ -314,7 +314,7 @@ function TDiskDiffsDlg.GetCachedDiff(FileOwner: TObject; AltFilename: string
): PDiffItem;
var
i: integer;
fs: TFileStreamUTF8;
fs: TFileStream;
Filename: String;
AnUnitInfo: TUnitInfo;
APackage: TLazPackage;
@ -353,7 +353,7 @@ begin
Filename:='';
Source:='';
end;
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead);
fs:=TFileStream.Create(Filename,fmOpenRead);
SetLength(Result^.TxtOnDisk,fs.Size);
if Result^.TxtOnDisk<>'' then
fs.Read(Result^.TxtOnDisk[1],length(Result^.TxtOnDisk));

View File

@ -44,8 +44,7 @@ uses
// LCL
Graphics, LCLProc, LResources, Forms, Dialogs, ComCtrls, LCLType, Controls,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazClasses, LazUTF8Classes, Laz2_XMLCfg,
LazStringUtils,
FileUtil, LazFileUtils, LazUTF8, LazClasses, Laz2_XMLCfg, LazStringUtils,
// Synedit
SynEdit, SynEditAutoComplete, SynEditKeyCmds, SynEditTypes,
SynEditMiscClasses, SynBeautifier, SynEditTextTrimmer, SynEditMouseCmds,
@ -5331,7 +5330,7 @@ begin
Result := mrAbort;
if FileExistsUTF8(s) then begin
try
LoadStringsFromFileUTF8(AnAutoComplete.AutoCompleteList, s);
AnAutoComplete.AutoCompleteList.LoadFromFile(s);
Result := mrOK;
except
Result := mrAbort;
@ -5383,7 +5382,7 @@ function TEditorOptions.SaveCodeTemplates(AnAutoComplete: TSynEditAutoComplete
): TModalResult;
begin
try
SaveStringsToFileUTF8(AnAutoComplete.AutoCompleteList, CodeTemplateFileNameExpand);
AnAutoComplete.AutoCompleteList.SaveToFile(CodeTemplateFileNameExpand);
Result := mrOK;
except
Result := mrAbort;

View File

@ -37,8 +37,7 @@ uses
Forms, Buttons, ExtCtrls, Controls, LMessages, LCLType, LCLIntf,
Graphics, Themes, ImgList, Menus, Clipbrd, Dialogs, StdCtrls,
// LazUtils
GraphType, UTF8Process, FileProcs, LazFileCache, LazFileUtils,
LazUTF8Classes, LazUTF8,
GraphType, UTF8Process, FileProcs, LazFileCache, LazFileUtils, LazUTF8,
// SynEdit
SynEdit, SynEditMarks,
// IDEIntf
@ -3417,7 +3416,7 @@ var
Dlg: TSaveDialog;
s: String;
Filename: String;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
Dlg:=IDESaveDialogClass.Create(nil);
try
@ -3432,7 +3431,7 @@ begin
s:=AllMessagesAsString(OnlyShown);
try
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
try
if s<>'' then
fs.Write(s[1],length(s));

View File

@ -5,10 +5,17 @@ unit ExampleManager;
interface
uses
Classes, SysUtils, lazutf8classes, ListFilterEdit, Forms, Controls, Dialogs,
StdCtrls, ExtCtrls, ButtonPanel, Buttons, EditBtn, LCLProc, FileUtil, LazFileUtils,
IDEWindowIntf, LazIDEIntf, IDEImagesIntf, MainIntf, EnvironmentOpts,
LazarusIDEStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, Dialogs, StdCtrls, ExtCtrls, ButtonPanel, Buttons, EditBtn,
// LazControls
ListFilterEdit,
// LazUtils
FileUtil, LazFileUtils,
// IdeIntf
IDEWindowIntf, LazIDEIntf, IDEImagesIntf, MainIntf,
// IDE
EnvironmentOpts, LazarusIDEStrConsts;
type
@ -362,7 +369,7 @@ begin
ReadMe:=ExtractFilePath(ProjectsListBox.Items[i])+'README.txt';
RealReadMe:=FindDiskFileCaseInsensitive(ReadMe);
if RealReadMe <> '' then
LoadStringsFromFileUTF8(DescriptionMemo.Lines,RealReadMe)
DescriptionMemo.Lines.LoadFromFile(RealReadMe)
else
DescriptionMemo.Clear;
Break;

View File

@ -40,7 +40,7 @@ interface
uses
Classes, SysUtils,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, LazLogger,
FileUtil, LazFileUtils, LazUTF8, LazLogger,
// IDE
LazConf;
@ -107,7 +107,7 @@ begin
CfgFileName := AppendPathDelim(ProgramDirectory) + 'lazarus.cfg';
if FileExistsUTF8(CfgFileName) then begin
DebugLn(['using config file ', CfgFileName]);
CfgFileContent := TStringListUTF8.Create;
CfgFileContent := TStringList.Create;
CfgFileContent.LoadFromFile(CfgFileName);
end;
Result := CfgFileContent;

View File

@ -36,7 +36,7 @@ uses
// CodeTools
DefineTemplates, CodeToolManager, FileProcs,
// LazUtils
LazUTF8Classes, LazFileUtils, LazUTF8,
LazFileUtils, LazUTF8,
// Other
IDEWindowIntf, LazIDEIntf, BaseBuildManager,
Project, EnvironmentOpts, LazarusIDEStrConsts, AboutFrm, TransferMacros;
@ -146,7 +146,7 @@ var
TestFilename: String;
Filename: String;
WorkDir: String;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
sl:=TStringList.Create;
List:=nil;
@ -200,7 +200,7 @@ begin
sl.Add('Working directory: '+WorkDir);
// create empty file
try
fs:=TFileStreamUTF8.Create(TestFilename,fmCreate);
fs:=TFileStream.Create(TestFilename,fmCreate);
fs.Free;
except
sl.Add('ERROR: unable to create test file '+TestFilename);

View File

@ -40,9 +40,9 @@ unit IDEGuiCmdLine;
interface
uses
Classes, SysUtils, math,
Classes, SysUtils, Math,
// LazUtils
LazUTF8Classes, LazUtilities, LazFileUtils,
LazUtilities, LazFileUtils,
// Codetools
FileProcs,
// IDE
@ -191,10 +191,10 @@ function SetupMainIDEInstance: boolean;
procedure WritePIDFile(const Filename: string; aPID: int64);
var
Dir: String;
sl: TStringListUTF8;
sl: TStringList;
begin
debugln(['WritePIDFile File="',Filename,'" PID=',aPID]);
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.Add(IntToStr(aPID));
try
@ -218,13 +218,13 @@ function SetupMainIDEInstance: boolean;
function ReadPIDFile(const Filename: string; out ConfigPID: int64): boolean;
var
sl: TStringListUTF8;
sl: TStringList;
begin
Result:=false;
ConfigPID:=-1;
debugln(['ReadPIDFile ',Filename]);
if not FileExistsUTF8(Filename) then exit;
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
try
sl.LoadFromFile(Filename);
@ -244,12 +244,12 @@ function SetupMainIDEInstance: boolean;
procedure SendCmdlineActionsToMainInstance;
var
sl: TStringListUTF8;
sl: TStringList;
Param: String;
Filename: String;
i: Integer;
begin
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.Add('Show');
for i:=1 to ParamsAndCfgCount do begin

View File

@ -38,7 +38,7 @@ uses
LCLProc, LCLIntf, LCLType, FileProcs, Forms, Controls, ComCtrls, StdCtrls,
Dialogs, Graphics, Buttons, ButtonPanel, LazHelpHTML, HelpIntfs,
// LazUtils
LConvEncoding, LazUTF8Classes, LazFileUtils, HTML2TextRender,
LConvEncoding, LazFileUtils, HTML2TextRender,
// CodeTools
BasicCodeTools, CodeToolManager, CodeCache, CustomCodeTool, CodeTree,
PascalParserTool, FindDeclarationTool,
@ -768,7 +768,7 @@ function TLIHProviders.GetStream(const URL: string; Shared: boolean): TStream;
procedure OpenFile(out Stream: TStream; const Filename: string;
UseCTCache: boolean);
var
fs: TFileStreamUTF8;
fs: TFileStream;
ok: Boolean;
Buf: TCodeBuffer;
ms: TMemoryStream;
@ -786,7 +786,7 @@ function TLIHProviders.GetStream(const URL: string; Shared: boolean): TStream;
ok:=false;
try
DebugLn(['TLIHProviders.GetStream.OpenFile ',Filename]);
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead);
fs:=TFileStream.Create(Filename,fmOpenRead);
Stream:=fs;
ok:=true;
finally

View File

@ -33,7 +33,7 @@ uses
// RTL
Classes, SysUtils, Laz_AVL_Tree,
// LazUtils
FileUtil, LazFileUtils, LazUtilities, LazFileCache, LazUTF8, LazUTF8Classes,
FileUtil, LazFileUtils, LazUtilities, LazFileCache, LazUTF8,
Laz2_XMLCfg, AvgLvlTree, LazLoggerBase, LazTracer,
// LCL
StdCtrls, ExtCtrls,
@ -1329,12 +1329,12 @@ end;
function CreateEmptyFile(const Filename: string): boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
Result:=false;
try
InvalidateFileStateCache;
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
fs.Free;
Result:=true;
except

View File

@ -47,8 +47,7 @@ uses
// CodeTools
FileProcs, CodeToolManager, DefineTemplates,
// LazUtils
FileUtil, LazUTF8, LazUTF8Classes, LazFileUtils, LazStringUtils, LazFileCache,
LazLoggerBase,
FileUtil, LazUTF8, LazFileUtils, LazStringUtils, LazFileCache, LazLoggerBase,
// IdeIntf
MacroDefIntf, IDEDialogs, IDEImagesIntf, IDEUtils,
// DebuggerIntf
@ -1360,8 +1359,8 @@ var
IsFirstStart: Boolean;
PrimaryFilename: String;
SecondaryFilename: String;
PrimaryEnvs: TStringListUTF8;
SecondaryEnvs: TStringListUTF8;
PrimaryEnvs: TStringList;
SecondaryEnvs: TStringList;
begin
IsFirstStart:=not FileExistsCached(EnvironmentOptions.Filename);
if not IsFirstStart then begin
@ -1371,8 +1370,8 @@ begin
if FileExistsUTF8(PrimaryFilename)
and FileExistsUTF8(SecondaryFilename) then begin
// compare content of primary and secondary config
PrimaryEnvs:=TStringListUTF8.Create;
SecondaryEnvs:=TStringListUTF8.Create;
PrimaryEnvs:=TStringList.Create;
SecondaryEnvs:=TStringList.Create;
try
PrimaryEnvs.LoadFromFile(PrimaryFilename);
except

View File

@ -37,8 +37,7 @@ uses
// CodeTools
DefineTemplates, CodeToolManager, FileProcs,
// LazUtils
LazFileCache, LazUTF8, LazUTF8Classes, LazFileUtils, FileUtil,
LazLoggerBase, Laz2_XMLCfg,
LazFileCache, LazUTF8, LazFileUtils, FileUtil, LazLoggerBase, Laz2_XMLCfg,
// IDE
LazarusIDEStrConsts, LazConf, EnvironmentOpts, FppkgHelper;
@ -147,7 +146,7 @@ function CheckLazarusDirectoryQuality(ADirectory: string;
end;
var
sl: TStringListUTF8;
sl: TStringList;
VersionIncFile: String;
Version: String;
begin
@ -166,7 +165,7 @@ begin
if not SubFileExists('ide/lazarus.lpi',Result) then exit;
VersionIncFile:=GetForcedPathDelims('ide/version.inc');
if not SubFileExists(VersionIncFile,Result) then exit;
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
try
sl.LoadFromFile(ADirectory+VersionIncFile);
@ -685,7 +684,7 @@ function CheckFPCSrcDirQuality(ADirectory: string; out Note: string;
var
VersionFile: String;
sl: TStringListUTF8;
sl: TStringList;
i: Integer;
VersionNr: String;
ReleaseNr: String;
@ -712,7 +711,7 @@ begin
VersionFile:=ADirectory+'compiler'+PathDelim+'version.pas';
if FileExistsInternal(VersionFile) then
begin
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
try
sl.LoadFromFile(VersionFile);

View File

@ -95,7 +95,7 @@ uses
// LCL
Forms, Controls, Dialogs,
// LazUtils
UTF8Process, FileUtil, LazFileUtils, LazUtilities, LazUTF8, LazUTF8Classes,
UTF8Process, FileUtil, LazFileUtils, LazUtilities, LazUTF8,
// CodeTools
FileProcs,
// IdeIntf

View File

@ -48,7 +48,7 @@ interface
uses
SysUtils, Classes,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, LazLoggerBase,
FileUtil, LazFileUtils, LazUTF8, LazLoggerBase,
// Codetools
DefineTemplates;
@ -153,12 +153,12 @@ function CreateCompilerTestPascalFilename: string;
function CreateFile(const Filename: string): boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
if FileExistsUTF8(Filename) then exit(true);
Result:=false;
try
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
fs.Free;
Result:=true;
except

View File

@ -69,7 +69,7 @@ uses
StdCodeTools, EventCodeTool, CodeCreationDlg, IdentCompletionTool,
// LazUtils
// use lazutf8, lazfileutils and lazfilecache after FileProcs and FileUtil
FileUtil, LazFileUtils, LazUtilities, LazUTF8, LazUTF8Classes, UTF8Process,
FileUtil, LazFileUtils, LazUtilities, LazUTF8, UTF8Process,
LConvEncoding, Laz2_XMLCfg, LazLoggerBase, LazLogger, LazFileCache, AvgLvlTree,
GraphType, LazStringUtils,
LCLExceptionStacktrace,
@ -7117,7 +7117,7 @@ var
Filename, Ext: String;
begin
Dir:=AppendPathDelim(Dir);
Files:=TStringListUTF8.Create;
Files:=TStringList.Create;
try
CodeToolBoss.DirectoryCachePool.GetListing(Dir,Files,false);
for i:=0 to Files.Count-1 do begin
@ -7352,7 +7352,7 @@ function TMainIDE.DoRunProjectWithoutDebug: TModalResult;
var
Process: TProcessUTF8;
RunCmdLine, RunWorkingDirectory, ExeFile: string;
Params: TStringListUTF8;
Params: TStringList;
RunAppBundle, Handled: Boolean;
ARunMode: TRunParamsOptionsMode;
begin
@ -7380,7 +7380,7 @@ begin
Exit(mrNone);
end;
Params:=TStringListUTF8.Create;
Params:=TStringList.Create;
Process := TProcessUTF8.Create(nil);
try
RunAppBundle:={$IFDEF Darwin}true{$ELSE}false{$ENDIF};
@ -7616,7 +7616,7 @@ procedure TMainIDE.DoExecuteRemoteControl;
var
Filename: String;
List: TStringListUTF8;
List: TStringList;
Files: TStrings;
i: Integer;
CmdShow: Boolean;
@ -7625,7 +7625,7 @@ begin
if FileExistsUTF8(Filename) and (FRemoteControlFileAge<>FileAgeUTF8(Filename))
then begin
// the control file exists and has changed
List:=TStringListUTF8.Create;
List:=TStringList.Create;
Files:=nil;
try
// load and delete the file
@ -12620,11 +12620,11 @@ end;
procedure TMainIDE.FPCMsgFilePoolLoadFile(aFilename: string; out s: string);
// Note: called by any thread
var
fs: TFileStreamUTF8;
fs: TFileStream;
Encoding: String;
begin
s:='';
fs := TFileStreamUTF8.Create(aFilename, fmOpenRead or fmShareDenyNone);
fs := TFileStream.Create(aFilename, fmOpenRead or fmShareDenyNone);
try
SetLength(s,fs.Size);
if s<>'' then

View File

@ -39,7 +39,7 @@ uses
// LCL
LCLProc, Graphics,
// LazUtils
FileUtil, LazFileUtils, LazFileCache, Laz2_XMLCfg, lazutf8classes,
FileUtil, LazFileUtils, LazFileCache, Laz2_XMLCfg,
// Codetools
FileProcs,
// IdeIntf
@ -185,7 +185,7 @@ end;
function TProjectIcon.SaveIconFile: Boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
begin
Result := False;
if IsEmpty then exit;
@ -193,7 +193,7 @@ begin
exit(true);
// write ico file
try
fs:=TFileStreamUTF8.Create(IcoFileName,fmCreate);
fs:=TFileStream.Create(IcoFileName,fmCreate);
try
fs.Write(FData[0],length(FData));
InvalidateFileStateCache(IcoFileName);
@ -212,7 +212,7 @@ end;
procedure TProjectIcon.SetIsEmpty(const AValue: Boolean);
var
NewData: TIconData;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
if IsEmpty=AValue then exit;
if AValue then
@ -225,7 +225,7 @@ begin
begin
// We need to restore data from the .ico file
try
fs:=TFileStreamUTF8.Create(IcoFileName,fmOpenRead);
fs:=TFileStream.Create(IcoFileName,fmOpenRead);
try
SetLength(NewData, fs.Size);
if length(NewData)>0 then

View File

@ -35,7 +35,7 @@ uses
WSReferences, Graphics, ImgList, ActnList, Themes, Menus,
Controls, Forms, StdCtrls, ExtCtrls, ToolWin, Buttons,
// LazUtils
GraphType, LazUTF8, LazUTF8Classes, LazLoggerBase, LazUtilities;
GraphType, LazUTF8, LazLoggerBase, LazUtilities;
type
THitTest = (htAbove, htBelow, htNowhere, htOnItem, htOnButton, htOnIcon,

View File

@ -59,7 +59,7 @@ uses
LCLVersion, LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache,
IntfGraphics, IcnsTypes, WSReferences,
// LazUtils
GraphType, GraphMath, FPCAdds, LazUTF8Classes, LazLoggerBase, LazTracer, LazUtilities;
GraphType, GraphMath, FPCAdds, LazLoggerBase, LazTracer, LazUtilities;
type
PColor = ^TColor;

View File

@ -39,7 +39,7 @@ uses
LCLStrConsts, LCLType, LCLIntf, Controls, Graphics, Forms,
LMessages, StdCtrls, LResources, MaskEdit, Buttons, Clipbrd, Themes, imglist,
// LazUtils
LazFileUtils, DynamicArray, Maps, LazUTF8, LazUtf8Classes, Laz2_XMLCfg,
LazFileUtils, DynamicArray, Maps, LazUTF8, Laz2_XMLCfg,
LazLoggerBase, LazUtilities, LCSVUtils, IntegerList
{$ifdef WINDOWS}
,messages, imm
@ -12025,9 +12025,9 @@ procedure TCustomStringGrid.LoadFromCSVFile(AFilename: string;
ADelimiter: Char=','; UseTitles: boolean=true; FromLine: Integer=0;
SkipEmptyLines: Boolean=true);
var
TheStream: TFileStreamUtf8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(AFileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromCSVStream(TheStream, ADelimiter, UseTitles, FromLine, SkipEmptyLines);
finally
@ -12110,9 +12110,9 @@ end;
procedure TCustomStringGrid.SaveToCSVFile(AFileName: string; ADelimiter: Char;
WriteTitles: boolean=true; VisibleColumnsOnly: boolean=false);
var
TheStream: TFileStreamUtf8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(AFileName,fmCreate);
TheStream:=TFileStream.Create(AFileName,fmCreate);
try
SaveToCSVStream(TheStream, ADelimiter, WriteTitles, VisibleColumnsOnly);
finally

View File

@ -125,7 +125,7 @@ procedure TGraphic.SaveToFile(const Filename: string);
var
Stream: TStream;
begin
Stream := TFileStreamUTF8.Create(Filename, fmCreate);
Stream := TFileStream.Create(Filename, fmCreate);
try
SaveToStream(Stream);
finally
@ -237,7 +237,7 @@ procedure TGraphic.LoadFromFile(const Filename: string);
var
Stream: TStream;
begin
Stream := TFileStreamUTF8.Create(Filename, fmOpenRead or fmShareDenyWrite);
Stream := TFileStream.Create(Filename, fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(Stream);
finally

View File

@ -529,7 +529,7 @@ begin
Ext := ExtractFileExt(Filename);
System.Delete(Ext, 1, 1); // delete '.'
Stream := TFileStreamUTF8.Create(Filename, fmOpenRead or fmShareDenyWrite);
Stream := TFileStream.Create(Filename, fmOpenRead or fmShareDenyWrite);
try
if Ext <> '' then
LoadFromStreamWithFileExt(Stream, Ext)
@ -608,7 +608,7 @@ begin
if (Ext <> '') and (Ext[1] = '.') then System.Delete(Ext, 1, 1); // delete '.'
Stream := TFileStreamUTF8.Create(Filename, fmCreate);
Stream := TFileStream.Create(Filename, fmCreate);
try
SaveToStreamWithFileExt(Stream, Ext);
finally

View File

@ -6001,7 +6001,7 @@ procedure TCustomTreeView.LoadFromFile(const FileName: string);
var
Stream: TStream;
begin
Stream := TFileStreamUTF8.Create(FileName, fmOpenRead or fmShareDenyWrite);
Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(Stream);
finally
@ -6023,7 +6023,7 @@ procedure TCustomTreeView.SaveToFile(const FileName: string);
var
Stream: TStream;
begin
Stream := TFileStreamUTF8.Create(FileName, fmCreate);
Stream := TFileStream.Create(FileName, fmCreate);
try
SaveToStream(Stream);
finally

View File

@ -28,7 +28,7 @@ uses
// LCL
LCLProc, LCLType, Graphics, Controls, StdCtrls,
// LazUtils
LazUtf8Classes, TextStrings, LazStringUtils,
TextStrings, LazStringUtils,
// LCL Carbon
CarbonEdits, CarbonListViews;
@ -436,9 +436,9 @@ end;
procedure TCarbonMemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -448,9 +448,9 @@ end;
procedure TCarbonMemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -29,7 +29,7 @@ uses
// LCL
Controls, StdCtrls, Graphics, LCLType, LMessages, LCLProc, LCLMessageGlue, Forms,
// LazUtils
LazUTF8, LazUTF8Classes, TextStrings,
LazUTF8, TextStrings,
// Widgetset
WSStdCtrls, WSLCLClasses, WSControls, WSProc,
// LCL Cocoa
@ -1388,9 +1388,9 @@ end;
procedure TCocoaMemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -1400,9 +1400,9 @@ end;
procedure TCocoaMemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -253,9 +253,9 @@ end;
procedure TGtk2MemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -265,9 +265,9 @@ end;
procedure TGtk2MemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -27,7 +27,7 @@ uses
// LazUtils
LazLoggerBase, LazTracer, LazStringUtils,
// LCL
Controls, Graphics, StdCtrls, LMessages, LCLType, LazUtf8Classes, LazUTF8,
Controls, Graphics, StdCtrls, LMessages, LCLType, LazUTF8,
// Widgetset
WSControls, WSProc, WSStdCtrls, Gtk2Int, Gtk2Def,
Gtk2CellRenderer, Gtk2Globals, Gtk2Proc, InterfaceBase,

View File

@ -21,7 +21,7 @@ unit gtk3private;
interface
uses Classes, SysUtils, Controls, LazGtk3, LazGObject2, LazGLib2, LazUtf8Classes;
uses Classes, SysUtils, Controls, LazGtk3, LazGObject2, LazGLib2;
type
@ -913,9 +913,9 @@ end;
procedure TGtk3MemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -925,9 +925,9 @@ end;
procedure TGtk3MemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -33,7 +33,7 @@ uses
// Free Pascal
Classes, SysUtils,
// LCL
Forms, Controls, LCLType, LazUTF8, ExtCtrls, StdCtrls, LazUtf8Classes,
Forms, Controls, LCLType, LazUTF8, ExtCtrls, StdCtrls,
//Widgetset
QtWidgets, qtproc;
@ -444,9 +444,9 @@ end;
procedure TQtMemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -456,9 +456,9 @@ end;
procedure TQtMemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -33,7 +33,7 @@ uses
// Free Pascal
Classes, SysUtils,
// LCL
Forms, Controls, LCLType, LazUTF8, ExtCtrls, StdCtrls, LazUtf8Classes,
Forms, Controls, LCLType, LazUTF8, ExtCtrls, StdCtrls,
//Widgetset
QtWidgets, qtproc;
@ -447,9 +447,9 @@ end;
procedure TQtMemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -459,9 +459,9 @@ end;
procedure TQtMemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -176,9 +176,9 @@ end;
procedure TWin32MemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -188,9 +188,9 @@ end;
procedure TWin32MemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -32,7 +32,7 @@ uses
StdCtrls, Controls, Graphics, Forms, Themes,
////////////////////////////////////////////////////
WSControls, WSStdCtrls, WSLCLClasses, WSProc, Windows, LCLIntf, LCLType,
LazUTF8, LazUtf8Classes, InterfaceBase, LMessages, LCLMessageGlue, TextStrings,
LazUTF8, InterfaceBase, LMessages, LCLMessageGlue, TextStrings,
Win32Int, Win32Proc, Win32WSControls, Win32Extra, Win32Themes;
type

View File

@ -182,9 +182,9 @@ end;
procedure TWinCEMemoStrings.LoadFromFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmOpenRead or fmShareDenyWrite);
TheStream:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(TheStream);
finally
@ -194,9 +194,9 @@ end;
procedure TWinCEMemoStrings.SaveToFile(const FileName: string);
var
TheStream: TFileStreamUTF8;
TheStream: TFileStream;
begin
TheStream:=TFileStreamUtf8.Create(FileName,fmCreate);
TheStream:=TFileStream.Create(FileName,fmCreate);
try
SaveToStream(TheStream);
finally

View File

@ -28,7 +28,7 @@ uses
{$ifdef Win32}win32compat,{$endif}
// RTL, FCL, LCL
SysUtils, LCLType, Classes, StdCtrls, Controls, Graphics, Forms, LCLProc,
InterfaceBase, LMessages, LCLMessageGlue, LazUTF8, LazUtf8Classes,
InterfaceBase, LMessages, LCLMessageGlue, LazUTF8,
// Widgetset
WSControls, WSStdCtrls, WSLCLClasses, WinCEInt, WinCEWSControls, WinCEExtra,
WSProc, WinCEProc;

View File

@ -28,8 +28,7 @@ uses
{$IFDEF Darwin}MacOSAll, {$ENDIF}
Classes, SysUtils, Math, Types, Laz_AVL_Tree,
// LazUtils
LazFileUtils, LazUtilities, LazMethodList, LazUTF8, LazUTF8Classes,
LazLoggerBase, LazTracer,
LazFileUtils, LazUtilities, LazMethodList, LazUTF8, LazLoggerBase, LazTracer,
// LCL
LCLStrConsts, LCLType;
@ -2215,15 +2214,15 @@ end;
procedure DbgOutThreadLog(const Msg: string);
var
PID: PtrInt;
fs: TFileStreamUTF8;
fs: TFileStream;
Filename: string;
begin
PID:=PtrInt(GetThreadID);
Filename:='Log'+IntToStr(PID);
if FileExistsUTF8(Filename) then
fs:=TFileStreamUTF8.Create(Filename,fmOpenWrite or fmShareDenyNone)
fs:=TFileStream.Create(Filename,fmOpenWrite or fmShareDenyNone)
else
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
fs:=TFileStream.Create(Filename,fmCreate);
fs.Position:=fs.Size;
fs.Write(Msg[1], length(Msg));
fs.Free;
@ -2287,7 +2286,7 @@ procedure DbgSaveData(FileName: String; AData: PChar; ADataSize: PtrUInt);
var
S: TStream;
begin
S := TFileStreamUTF8.Create(FileName, fmCreate);
S := TFileStream.Create(FileName, fmCreate);
S.Write(AData^, ADataSize);
S.Free;
end;

View File

@ -37,7 +37,7 @@ uses
// LCL
LCLProc, LCLStrConsts,
// LazUtils
LazConfigStorage, FPCAdds, DynQueue, LazUTF8, LazUTF8Classes, LazLoggerBase;
LazConfigStorage, FPCAdds, DynQueue, LazUTF8, LazLoggerBase;
{$DEFINE UseLRS}
{$DEFINE UseRES}
@ -1361,13 +1361,13 @@ end;
function LFMtoLRSfile(const LFMfilename: string):boolean;
// returns true if successful
var
LFMFileStream, LRSFileStream: TFileStreamUTF8;
LFMFileStream, LRSFileStream: TFileStream;
LFMMemStream, LRSMemStream: TMemoryStream;
LRSfilename, LFMfilenameExt: string;
begin
Result:=true;
try
LFMFileStream:=TFileStreamUTF8.Create(LFMfilename,fmOpenRead);
LFMFileStream:=TFileStream.Create(LFMfilename,fmOpenRead);
LFMMemStream:=TMemoryStream.Create;
LRSMemStream:=TMemoryStream.Create;
try
@ -1380,7 +1380,7 @@ begin
Result:=LFMtoLRSstream(LFMMemStream,LRSMemStream);
if not Result then exit;
LRSMemStream.Position:=0;
LRSFileStream:=TFileStreamUTF8.Create(LRSfilename,fmCreate);
LRSFileStream:=TFileStream.Create(LRSfilename,fmCreate);
try
LRSFileStream.CopyFrom(LRSMemStream,LRSMemStream.Size);
finally
@ -2106,13 +2106,13 @@ end;
function ReadLFMHeaderFromFile(const Filename: string; out LFMType,
LFMComponentName, LFMClassName: String): boolean;
var
fs: TFileStreamUTF8;
fs: TFileStream;
Header: string;
Cnt: LongInt;
begin
Result:=false;
try
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead);
fs:=TFileStream.Create(Filename,fmOpenRead);
try
SetLength(Header,600);
Cnt:=fs.Read(Header[1],length(Header));

View File

@ -48,7 +48,7 @@ uses
LCLType, LCLIntf, LCLProc,
Graphics, Forms, IntfGraphics, Printers, PostScriptUnicode,
// LazUtils
GraphType, GraphMath, LazFileUtils, IntegerList, LazUTF8, LazUTF8Classes;
GraphType, GraphMath, LazFileUtils, IntegerList, LazUTF8;
Type
@ -1270,9 +1270,10 @@ begin
end;
procedure TPostScriptPrinterCanvas.SaveToFile(aFileName: string);
Var Lst : TStringListUTF8;
Var
Lst : TStringList;
begin
Lst:=TStringListUTF8.Create;
Lst:=TStringList.Create;
try
Lst.AddStrings(fHeader);
Lst.AddStrings(fDocument);

View File

@ -20,7 +20,7 @@ uses
// LCL
LCLProc, Forms,
// LazUtils
LazConfigStorage, LazUTF8, LazUTF8Classes;
LazConfigStorage, LazUTF8;
type
{ TPropStorageXMLConfig }
@ -307,14 +307,14 @@ constructor TXMLConfigStorage.Create(const Filename: string;
LoadFromDisk: Boolean);
var
ms: TMemoryStream;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
FXMLConfig:=TPropStorageXMLConfig.Create(nil);
FFilename:=Filename;
FFreeXMLConfig:=true;
if LoadFromDisk then
begin
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead+fmShareDenyWrite);
fs:=TFileStream.Create(Filename,fmOpenRead+fmShareDenyWrite);
try
ms:=TMemoryStream.Create;
try
@ -363,7 +363,7 @@ end;
procedure TXMLConfigStorage.WriteToDisk;
var
ms: TMemoryStream;
fs: TFileStreamUTF8;
fs: TFileStream;
begin
if FXMLConfig is TPropStorageXMLConfig then
begin
@ -371,7 +371,7 @@ begin
try
TPropStorageXMLConfig(FXMLConfig).SaveToStream(ms);
ms.Position:=0;
fs:=TFileStreamUTF8.Create(GetFilename,fmCreate);
fs:=TFileStream.Create(GetFilename,fmCreate);
try
fs.CopyFrom(ms,ms.Size);
finally

View File

@ -43,8 +43,8 @@ uses
// LCL
Forms,
// LazUtils
Laz2_XMLCfg, LazFileCache, LazUTF8Classes, LazFileUtils, FileUtil,
LazTracer, LazUtilities, AvgLvlTree,
Laz2_XMLCfg, LazFileCache, LazFileUtils, FileUtil, LazUtilities, LazTracer,
AvgLvlTree,
// Codetools
FileProcs, CodeToolManager,
// BuildIntf
@ -434,7 +434,7 @@ var
NewPkgName: string;
PkgVersion: TPkgVersion;
CurPkgLink, OldPkgLink, OtherPkgLink: TLazPackageLink;
sl: TStringListUTF8;
sl: TStringList;
LPLFilename: String;
LPKFilename, LazDir: string;
Files: TStrings;
@ -454,7 +454,7 @@ begin
UnmappedGlobalLinks:=FGlobalLinks;
FGlobalLinks:=TAvlTree.Create(@ComparePackageLinks);
MappedGlobalLinks:=TAvlTree.Create(@ComparePackageLinks);
Files:=TStringListUTF8.Create;
Files:=TStringList.Create;
PkgVersion:=TPkgVersion.Create;
try
GlobalLinksDir:=GetGlobalLinkDirectory;
@ -470,7 +470,7 @@ begin
continue;
end;
LPKFilename:='';
sl:=TStringListUTF8.Create;
sl:=TStringList.Create;
try
sl.LoadFromFile(LPLFilename);
if sl.Count<=0 then begin

View File

@ -51,7 +51,7 @@ uses
// LCL
Forms, Controls, Dialogs, Menus, ComCtrls, LResources,
// LazUtils
LazUTF8, Laz2_XMLCfg, LazUTF8Classes, LazTracer, LazUtilities, LazStringUtils,
LazUTF8, Laz2_XMLCfg, LazTracer, LazUtilities, LazStringUtils,
LazFileUtils, LazFileCache, StringHashList, AvgLvlTree, ObjectLists, Translations,
// Codetools
CodeToolsConfig, CodeToolManager, CodeCache, BasicCodeTools,
@ -731,13 +731,13 @@ end;
{$IFDEF UseLRS}
procedure TPkgManager.AddToIconResource(const aIconFile, aResName: string);
var
BinFileStream: TFileStreamUTF8;
BinFileStream: TFileStream;
ResMemStream: TMemoryStream;
ResType: String;
OldLen, NewLen: integer;
begin
try
BinFileStream:=TFileStreamUTF8.Create(aIconFile,fmOpenRead);
BinFileStream:=TFileStream.Create(aIconFile,fmOpenRead);
try
ResMemStream:=TMemoryStream.Create;
try
@ -4785,7 +4785,7 @@ var
UGUnit: TUGUnit;
begin
debugln(['TPkgManager.GetUnitsOfOwners piguListed=',piguListed in Flags,' piguUsed=',piguUsed in Flags,' piguAllUsed=',piguAllUsed in Flags]);
Result:=TStringListUTF8.Create;
Result:=TStringList.Create;
if (OwnerList=nil) or (OwnerList.Count=0) then exit;
Units:=TFilenameToPointerTree.Create(false);

View File

@ -35,7 +35,7 @@ uses
// LCL
Forms, Controls, Dialogs, StdCtrls, ExtCtrls, LCLproc, ComCtrls,
// LazUtils
LazFileUtils, LazStringUtils, LazUTF8, LazUTF8Classes;
LazFileUtils, LazStringUtils, LazUTF8;
type
@ -353,13 +353,13 @@ var
StartFound: Boolean;
StartTag, EndTag: String;
Line, LineName: String;
Lines: TStringListUTF8;
Lines: TStringList;
n: Integer;
begin
AResult.Clear;
if not FileExistsUTF8(AFileName) then Exit;
Lines := TStringListUTF8.Create;
Lines := TStringList.Create;
Lines.LoadFromFile(AFileName);
StartFound := False;
@ -513,7 +513,7 @@ const
PROC_DESC: array[TProcType] of String = ('Function', 'Procedure');
PROC_RESULT: array[TProcType] of String = ('Result := ', '');
var
ApiText, ProcLines, ProcParams: TStringListUTF8;
ApiText, ProcLines, ProcParams: TStringList;
S, DeclarationText: String;
ProcName, FileName, IntfBase: String;
PlatformPrefix, PlatformDir, PlatformObject: String;
@ -553,9 +553,9 @@ begin
end;
LineCount := 0;
ProcParams := TStringListUTF8.Create;
ApiText := TStringListUTF8.Create;
ProcLines := TStringListUTF8.Create;
ProcParams := TStringList.Create;
ApiText := TStringList.Create;
ProcLines := TStringList.Create;
try
for Line := 0 to txtDeclarations.Lines.Count - 1 do
begin

View File

@ -1,5 +1,3 @@
unit glazresmain;
{
***************************************************************************
* *
@ -25,9 +23,10 @@ unit glazresmain;
Adapted by: Bart Broersma
GLazRes aims to be a GUI implementation of the LazRes program.
}
unit glazresmain;
{$mode objfpc}{$H+}
interface
@ -36,7 +35,7 @@ uses
Classes, SysUtils, Types, IniFiles,
Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtDlgs, EditBtn,
LResources, LCLProc, LCLType,
LazFileUtils, LazUTF8, LazUtf8Classes;
LazFileUtils, LazUTF8;
type
@ -439,7 +438,7 @@ procedure TGLazResForm.CreateLazarusResourceFile;
var
FileCount, Index:integer;
S:string;
ResFileStream, BinFileStream: TFileStreamUtf8;
ResFileStream, BinFileStream: TFileStream;
ResMemStream, BinMemStream: TMemoryStream;
ResourceFilename, FullResourceFilename, BinFilename, BinExt, ResourceName, ResourceType,
ExpS: String;
@ -471,7 +470,7 @@ begin
end;
try
AddMessageFmt(MsgCreatingLrs,[FullResourceFilename]);
ResFileStream:=TFileStreamUtf8.Create(FullResourceFileName,fmCreate);
ResFileStream:=TFileStream.Create(FullResourceFileName,fmCreate);
except
AddMessageFmt(ErrCreate,[ResourceFileName]);
exit;
@ -483,7 +482,7 @@ begin
BinFilename:=FileListBox.Items[Index];
AddMessageFmt(MsgProcessing,[BinFilename]);
try
BinFileStream:=TFileStreamUtf8.Create(BinFilename, fmOpenRead);
BinFileStream:=TFileStream.Create(BinFilename, fmOpenRead);
BinMemStream:=TMemoryStream.Create;
try
BinMemStream.CopyFrom(BinFileStream, BinFileStream.Size);

View File

@ -24,7 +24,7 @@ program iconvtable;
uses
Classes, SysUtils, Unix,
LazFileUtils, LazUTF8, LazUTF8Classes;
LazFileUtils, LazUTF8;
var
Table: array[0..255] of shortstring;
@ -108,7 +108,7 @@ begin
end;
var
SL: TStringListUTF8;
SL: TStringList;
Filename1, Filename2: String;
FromEncoding, ToEncoding: String;
s: String;
@ -122,7 +122,7 @@ begin
FromEncoding:=ParamStrUTF8(1);
ToEncoding:='UTF-8';
SL:=TStringListUTF8.Create;
SL:=TStringList.Create;
for i:=0 to 255 do begin
Table[i]:=chr(i);
if i<32 then continue;

View File

@ -26,7 +26,7 @@ uses
cthreads,
{$ENDIF}
Classes, SysUtils, Unix, MTProcs,
LazFileUtils, LazUTF8, LazUTF8Classes, LazLoggerBase, LConvEncoding;
LazFileUtils, LazUTF8, LazLoggerBase, LConvEncoding;
var
FromEncoding: String;
@ -110,7 +110,7 @@ procedure AskIconvInParallel(Index: PtrInt; {%H-}Data: Pointer;
var
FilenameOrig: String;
FilenameUTF8: String;
SL: TStringListUTF8;
SL: TStringList;
s: String;
CharLen: integer;
i: Integer;
@ -130,7 +130,7 @@ begin
FilenameUTF8:='testutf'+IntToStr(i)+'.txt';
DeleteFileUTF8(FilenameOrig);
DeleteFileUTF8(FilenameUTF8);
SL:=TStringListUTF8.Create;
SL:=TStringList.Create;
SL.Add(chr(Index shr 8)+chr(Index and 255));
SL.SaveToFile(FilenameOrig);
if fpSystem('iconv -f '+FromEncoding+' -t '+ToEncoding+' '+FilenameOrig+' >'+FilenameUTF8)=0

View File

@ -42,7 +42,7 @@ program LazRes;
uses
Classes, SysUtils, LazLogger, LResources, resource, reswriter,
bitmapresource, groupresource, groupiconresource, groupcursorresource,
LazFileUtils, LazUTF8, LazUTF8Classes;
LazFileUtils, LazUTF8;
type
TOutputFileType = (ftLrs, ftRc, ftRes);
@ -75,12 +75,12 @@ end;
procedure OutputLRSFile(BinFilename, ResourceName: String; ResMemStream: TMemoryStream);
var
BinExt,ResourceType: String;
BinFileStream: TFileStreamUTF8;
BinFileStream: TFileStream;
BinMemStream: TMemoryStream;
begin
dbgout(BinFilename);
try
BinFileStream:=TFileStreamUTF8.Create(BinFilename,fmOpenRead);
BinFileStream:=TFileStream.Create(BinFilename,fmOpenRead);
BinMemStream:=TMemoryStream.Create;
try
BinMemStream.CopyFrom(BinFileStream,BinFileStream.Size);
@ -164,9 +164,9 @@ var
function GetResourceStream: TMemoryStream;
var
FS: TFileStreamUTF8;
FS: TFileStream;
begin
FS := TFileStreamUTF8.Create(FileName, fmOpenRead);
FS := TFileStream.Create(FileName, fmOpenRead);
Result := TMemoryStream.Create;
try
Result.CopyFrom(FS, FS.Size);
@ -296,7 +296,7 @@ end;
var
a: Integer;
ResourceFilename,FullResourceFilename:String;
ResFileStream:TFileStreamUTF8;
ResFileStream:TFileStream;
ResMemStream:TMemoryStream;
FileList:TStringList;
S: String;
@ -309,7 +309,7 @@ begin
,' resourcefilename @filelist');
exit;
end;
FileList:=TStringListUTF8.Create;
FileList:=TStringList.Create;
try
if ParamStrUTF8(2)[1] = '@' then
begin
@ -356,7 +356,7 @@ begin
end;
try
ResFileStream:=TFileStreamUTF8.Create(ResourceFilename,fmCreate);
ResFileStream:=TFileStream.Create(ResourceFilename,fmCreate);
except
debugln('ERROR: unable to create file ''', ResourceFilename, '''');
halt(1);

View File

@ -59,7 +59,7 @@ program Svn2RevisionInc;
uses
Classes, CustApp, SysUtils, Process, Dom, XmlRead,
// LazUtils
FileUtil, LazFileUtils, LazUTF8, LazUTF8Classes, UTF8Process, LazLogger;
FileUtil, LazFileUtils, LazUTF8, UTF8Process, LazLogger;
type
@ -329,14 +329,14 @@ var
var
EntriesFileName: string;
Line: string;
Lines: TStringListUTF8;
Lines: TStringList;
i: Integer;
begin
Result:=false;
EntriesFileName:=AppendPathDelim(SourceDirectory)+'.svn'+PathDelim+'entries';
if FileExistsUTF8(EntriesFileName) then begin
try
Lines:=TStringListUTF8.Create;
Lines:=TStringList.Create;
try
Lines.LoadFromFile(EntriesFileName);
// skip three lines
@ -441,12 +441,12 @@ end;
function TSvn2RevisionApplication.IsValidRevisionInc: boolean;
var
Lines: TStringListUTF8;
Lines: TStringList;
begin
Result := FileExistsUTF8(RevisionIncFileName);
if Result then
begin
Lines := TStringListUTF8.Create;
Lines := TStringList.Create;
try
Lines.LoadFromFile(RevisionIncFileName);
Result := (Lines.Count = 2) and