mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 18:03:49 +02:00
jcf: update from the main repository
git-svn-id: trunk@19107 -
This commit is contained in:
parent
05f7d868a7
commit
5a9e74a1fa
components/jcf2
CommandLine
JCFSettings.cfgJcfGui
JcfVersionConsts.pasNotepad
Parse
Process
ReadWrite
Settings
Ui/Settings
Utils
readme.txt@ -44,7 +44,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
@ -242,7 +241,7 @@ var
|
||||
else if AnsiSameText(lsOpt, 'out') then
|
||||
begin
|
||||
fbHasBackupMode := True;
|
||||
feCmdLineBackupMode := cmSeperateOutput;
|
||||
feCmdLineBackupMode := cmSeparateOutput;
|
||||
end
|
||||
else if AnsiSameText(lsOpt, 'backup') then
|
||||
begin
|
||||
|
@ -45,7 +45,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
@ -247,7 +246,7 @@ var
|
||||
else if AnsiSameText(lsOpt, 'out') then
|
||||
begin
|
||||
fbHasBackupMode := True;
|
||||
feCmdLineBackupMode := cmSeperateOutput;
|
||||
feCmdLineBackupMode := cmSeparateOutput;
|
||||
end
|
||||
else if AnsiSameText(lsOpt, 'backup') then
|
||||
begin
|
||||
|
@ -247,7 +247,7 @@ var
|
||||
else if AnsiSameText(lsOpt, 'out') then
|
||||
begin
|
||||
fbHasBackupMode := True;
|
||||
feCmdLineBackupMode := cmSeperateOutput;
|
||||
feCmdLineBackupMode := cmSeparateOutput;
|
||||
end
|
||||
else if AnsiSameText(lsOpt, 'backup') then
|
||||
begin
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" ?>
|
||||
<JediCodeFormatSettings>
|
||||
<WriteVersion> 2.42 </WriteVersion>
|
||||
<WriteVersion> 2.44 </WriteVersion>
|
||||
<WriteDateTime> 39387.7118126273 </WriteDateTime>
|
||||
<Description> JEDI Code Format Settings </Description>
|
||||
<Obfuscate>
|
||||
|
@ -40,7 +40,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
|
@ -162,13 +162,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription">JEDI Code Format</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.42.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.43.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.42</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.43</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
</Delphi.Personality>
|
||||
|
@ -40,7 +40,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
|
@ -162,13 +162,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription">JEDI Code Format</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.42.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.43.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.42</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.43</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
</Delphi.Personality>
|
||||
|
@ -115,10 +115,7 @@ object frmMain: TfrmMain
|
||||
Top = 226
|
||||
Width = 648
|
||||
Height = 331
|
||||
AutoSize = False
|
||||
ClipboardCommands = [caCopy]
|
||||
MaxLines = 0
|
||||
HideCaret = False
|
||||
Align = alClient
|
||||
ParentColor = True
|
||||
ReadOnly = True
|
||||
|
@ -30,7 +30,7 @@ unit fMain;
|
||||
}
|
||||
|
||||
|
||||
{$I JcfGlobal.inc}
|
||||
{$I ..\Include\JcfGlobal.inc}
|
||||
|
||||
interface
|
||||
|
||||
|
@ -30,8 +30,8 @@ See http://www.gnu.org/licenses/gpl.html
|
||||
interface
|
||||
|
||||
const
|
||||
PROGRAM_VERSION = '2.42';
|
||||
PROGRAM_DATE = 'December 2008';
|
||||
PROGRAM_VERSION = '2.44';
|
||||
PROGRAM_DATE = 'March 2009';
|
||||
PROGRAM_HOME_PAGE = 'http://jedicodeformat.sourceforge.net/';
|
||||
PROGRAM_SOURCEFORGE_HOME_PAGE = 'http://sourceforge.net/projects/jedicodeformat/';
|
||||
PROGRAM_SVN_TRUNK = 'http://jedicodeformat.svn.sourceforge.net/svnroot/jedicodeformat/trunk/CodeFormat/Jcf2/';
|
||||
|
@ -40,7 +40,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
|
@ -162,13 +162,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription">JCF Notepad</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.42.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.43.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.42</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.43</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
</Delphi.Personality>
|
||||
|
@ -40,7 +40,6 @@ uses
|
||||
VisitSetXY in '..\..\Process\VisitSetXY.pas',
|
||||
BaseVisitor in '..\..\Process\BaseVisitor.pas',
|
||||
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
|
||||
JcfFileUtils in '..\..\Utils\JcfFileUtils.pas',
|
||||
JcfLog in '..\..\Utils\JcfLog.pas',
|
||||
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
|
||||
SetUses in '..\..\Settings\SetUses.pas',
|
||||
|
@ -162,13 +162,13 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription">JCF Notepad</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.42.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">2.43.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.42</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">2.43</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
</Delphi.Personality>
|
||||
|
@ -44,31 +44,31 @@ object fmJCFNotepad: TfmJCFNotepad
|
||||
Align = alTop
|
||||
TabOrder = 1
|
||||
object sbLoad: TSpeedButton
|
||||
Left = 3
|
||||
Top = 3
|
||||
Width = 60
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 70
|
||||
Height = 29
|
||||
Action = actOpen
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
end
|
||||
object sbSave: TSpeedButton
|
||||
Left = 67
|
||||
Top = 3
|
||||
Width = 66
|
||||
Left = 148
|
||||
Top = 2
|
||||
Width = 94
|
||||
Height = 29
|
||||
Action = actSave
|
||||
end
|
||||
object sbGo: TSpeedButton
|
||||
Left = 135
|
||||
Top = 3
|
||||
Left = 74
|
||||
Top = 2
|
||||
Width = 72
|
||||
Height = 29
|
||||
Action = actGo
|
||||
end
|
||||
object sbClear: TSpeedButton
|
||||
Left = 209
|
||||
Top = 3
|
||||
Left = 244
|
||||
Top = 2
|
||||
Width = 70
|
||||
Height = 29
|
||||
Action = actClear
|
||||
@ -173,7 +173,7 @@ object fmJCFNotepad: TfmJCFNotepad
|
||||
OnExecute = actOpenExecute
|
||||
end
|
||||
object actSave: TAction
|
||||
Caption = '&Save...'
|
||||
Caption = '&Save output...'
|
||||
Hint = 'Save the output'
|
||||
OnExecute = actSaveExecute
|
||||
end
|
||||
@ -224,7 +224,6 @@ object fmJCFNotepad: TfmJCFNotepad
|
||||
end
|
||||
object mnuFileSaveOut: TMenuItem
|
||||
Action = actSave
|
||||
Caption = '&Save Output...'
|
||||
end
|
||||
object mnuFileSaveIn: TMenuItem
|
||||
Caption = 'Save &Input'
|
||||
|
@ -213,12 +213,10 @@ begin
|
||||
|
||||
ReadTextFile(psFileName, lsFileContents, feLastInputContentType);
|
||||
|
||||
// use standard line breaks - temp
|
||||
//lsFileContents := WideStringReplace(lsFileContents, NativeLineFeed, NativeCrLf, [rfReplaceAll]);
|
||||
|
||||
mInput.Text := lsFileContents;
|
||||
sb1.Panels[1].Text := psFileName;
|
||||
AddCheckMRU(psFileName);
|
||||
fsLastInputFileName := psFileName;
|
||||
|
||||
CheckInputState;
|
||||
SendShowFilePos;
|
||||
|
@ -1082,7 +1082,7 @@ begin
|
||||
|
||||
{ In Delphi.Net, the type can be preceeded by an attribute in '[ ]' }
|
||||
lc := fcTokenList.FirstSolidToken;
|
||||
while (lc.WordType in IdentifierTypes) or TypePastAttribute do
|
||||
while (lc <> nil) and ((lc.WordType in IdentifierTypes) or TypePastAttribute) do
|
||||
begin
|
||||
RecogniseTypeDecl;
|
||||
|
||||
@ -3632,8 +3632,10 @@ begin
|
||||
begin
|
||||
RecogniseBlock;
|
||||
|
||||
if fcTokenList.FirstSolidTokenType = ttSemiColon then
|
||||
if (not pbAnon) and (fcTokenList.FirstSolidTokenType = ttSemiColon) then
|
||||
begin
|
||||
Recognise(ttSemicolon);
|
||||
end;
|
||||
end;
|
||||
|
||||
PopNode;
|
||||
@ -3663,8 +3665,10 @@ begin
|
||||
begin
|
||||
RecogniseBlock;
|
||||
|
||||
if fcTokenList.FirstSolidTokenType = ttSemiColon then
|
||||
if (not pbAnon) and (fcTokenList.FirstSolidTokenType = ttSemiColon) then
|
||||
begin
|
||||
Recognise(ttSemicolon);
|
||||
end;
|
||||
end;
|
||||
|
||||
PopNode;
|
||||
@ -3892,7 +3896,7 @@ procedure TBuildParseTree.RecogniseProcedureDirectives;
|
||||
var
|
||||
lbFirstPass: boolean;
|
||||
begin
|
||||
{ these are semi-colon seperated
|
||||
{ these are semi-colon separated
|
||||
|
||||
want to leave 'Function foo;' as is,
|
||||
but strip off the '; safecall' off 'Function bar; safecall;'
|
||||
@ -4919,7 +4923,7 @@ begin
|
||||
-> [AsmLabel]
|
||||
-> Opcode [AsmParam] [',' AsmParam]...
|
||||
|
||||
NB whitespace is significant, i.e. returns can seperate statement
|
||||
NB whitespace is significant, i.e. returns can separate statement
|
||||
Help says ' semicolons, end-of-line characters, or Delphi comments.'
|
||||
|
||||
I know that the help claims that a label is a prefix on a statement,
|
||||
@ -4927,7 +4931,7 @@ begin
|
||||
so that would require a complete statement to consist of
|
||||
an optional label followed by an optional opcode
|
||||
|
||||
Anyway labels are usually placed on a seperate line
|
||||
Anyway labels are usually placed on a separate line
|
||||
|
||||
RET is opcode with no params
|
||||
}
|
||||
@ -5523,7 +5527,7 @@ begin
|
||||
begin
|
||||
lcNext := fcTokenList.SolidToken(2);
|
||||
if lcNext <> nil then
|
||||
Result := (lcNext.TokenType = ttOpenBracket);
|
||||
Result := (lcNext.TokenType in [ttOpenBracket, ttColon]);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -433,6 +433,8 @@ begin
|
||||
Result := 'Generic';
|
||||
nAnonymousMethod:
|
||||
Result := 'Anonymous method';
|
||||
nClassVars:
|
||||
Result := 'Class vars';
|
||||
nMethodReferenceType:
|
||||
Result := 'Method reference type';
|
||||
else
|
||||
|
@ -585,7 +585,7 @@ begin
|
||||
Inc(liIndentCount);
|
||||
|
||||
// program or library top level procs
|
||||
// re bug 1898723 ] Identination of procedures in library
|
||||
// re bug 1898723 - Identination of procedures in library
|
||||
if not FormatSettings.Indent.IndentLibraryProcs then
|
||||
begin
|
||||
if pt.HasParentNode([nLibrary, nProgram]) and (liIndentCount >= 1) then
|
||||
|
@ -255,8 +255,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function NeedsReturn(const pt, ptNext: TSourceToken): boolean;
|
||||
{ true if the "AddGoodReturns" setting wants a return here }
|
||||
function NeedsGoodReturn(const pt, ptNext: TSourceToken): boolean;
|
||||
const
|
||||
CLASS_FOLLOW = [ttOf, ttHelper];
|
||||
var
|
||||
@ -264,40 +264,6 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
{ these can include returns }
|
||||
if pt.TokenType = ttConditionalCompilationRemoved then
|
||||
exit;
|
||||
|
||||
{ option to Break After Uses }
|
||||
if pt.HasParentNode(nUses) and (pt.TokenType = ttUses) and
|
||||
FormatSettings.Returns.BreakAfterUses then
|
||||
begin
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
if pt.HasParentNode(nUses) and FormatSettings.Returns.UsesClauseOnePerLine then
|
||||
begin
|
||||
if (pt.TokenType = ttUses) then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (pt.TokenType in [ttComma, ttUses]) then
|
||||
begin
|
||||
// add a return, unless there's a comment just after the comma
|
||||
lcNext := pt.NextTokenWithExclusions([ttWhiteSpace]);
|
||||
if (lcNext <> nil) and (lcNext.TokenType <> ttComment) then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (pt.TokenType = ttReturn) then
|
||||
exit;
|
||||
|
||||
if (pt.TokenType in WordsJustReturnAfter) then
|
||||
begin
|
||||
Result := True;
|
||||
@ -498,7 +464,53 @@ begin
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function NeedsReturn(const pt, ptNext: TSourceToken): boolean;
|
||||
var
|
||||
lcNext: TSourceToken;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
{ these can include returns }
|
||||
if pt.TokenType = ttConditionalCompilationRemoved then
|
||||
exit;
|
||||
|
||||
{ option to Break After Uses }
|
||||
if pt.HasParentNode(nUses) and (pt.TokenType = ttUses) and
|
||||
FormatSettings.Returns.BreakAfterUses then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if pt.HasParentNode(nUses) and FormatSettings.Returns.UsesClauseOnePerLine then
|
||||
begin
|
||||
if (pt.TokenType = ttUses) then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (pt.TokenType in [ttComma, ttUses]) then
|
||||
begin
|
||||
// add a return, unless there's a comment just after the comma
|
||||
lcNext := pt.NextTokenWithExclusions([ttWhiteSpace]);
|
||||
if (lcNext <> nil) and (lcNext.TokenType <> ttComment) then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (pt.TokenType = ttReturn) then
|
||||
exit;
|
||||
|
||||
if FormatSettings.Returns.AddGoodReturns then
|
||||
begin
|
||||
Result := NeedsGoodReturn(pt, ptNext);
|
||||
end;
|
||||
end;
|
||||
|
||||
function IsAsmLabelEnd(const pcSourceToken: TSourceToken): boolean;
|
||||
@ -629,7 +641,9 @@ end;
|
||||
|
||||
function TReturnAfter.IsIncludedInSettings: boolean;
|
||||
begin
|
||||
Result := FormatSettings.Returns.AddGoodReturns;
|
||||
Result := FormatSettings.Returns.AddGoodReturns or
|
||||
FormatSettings.Returns.UsesClauseOnePerLine or
|
||||
FormatSettings.Returns.BreakAfterUses;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -33,7 +33,7 @@ interface
|
||||
this unit is simple type defs with no dependencies
|
||||
}
|
||||
type
|
||||
TBackupMode = (cmInPlace, cmInPlaceWithBackup, cmSeperateOutput);
|
||||
TBackupMode = (cmInPlace, cmInPlaceWithBackup, cmSeparateOutput);
|
||||
TSourceMode = (fmSingleFile, fmDirectory, fmDirectoryRecursive);
|
||||
|
||||
TStatusMessageType =
|
||||
|
@ -25,7 +25,7 @@ See http://www.gnu.org/licenses/gpl.html
|
||||
------------------------------------------------------------------------------*)
|
||||
{*)}
|
||||
|
||||
{$I JcfGlobal.inc}
|
||||
{$I ..\Include\JcfGlobal.inc}
|
||||
|
||||
interface
|
||||
|
||||
@ -116,7 +116,7 @@ uses
|
||||
{$ifndef fpc}Windows, {$endif} SysUtils, Dialogs, Controls, Forms,
|
||||
{ local }
|
||||
JcfStringUtils, JcfSystemUtils,
|
||||
JcfFileUtils, JcfMiscFunctions, JcfLog,
|
||||
JcfMiscFunctions, JcfLog,
|
||||
JcfRegistrySettings, JcfSettings, JcfUnicodeFiles;
|
||||
|
||||
constructor TFileConverter.Create;
|
||||
@ -173,9 +173,9 @@ begin
|
||||
|
||||
{ all kinds of chaos ensues if you work with readonly files,
|
||||
for e.g. you can rename them to .bak, but on the next run you will be unable to delete the old .bak files.
|
||||
They are only safe when the source is read not written, ie "output to seperate file" backup mode
|
||||
They are only safe when the source is read not written, ie "output to separate file" backup mode
|
||||
}
|
||||
if (BackupMode <> cmSeperateOutput) and (FileIsReadOnly(psInputFileName)) then
|
||||
if (BackupMode <> cmSeparateOutput) and (FileIsReadOnly(psInputFileName)) then
|
||||
begin
|
||||
Log.WriteError('File: ' + psInputFileName + ' cannot be processed as it is read only');
|
||||
exit;
|
||||
@ -312,7 +312,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
cmSeperateOutput:
|
||||
cmSeparateOutput:
|
||||
begin
|
||||
fsOutFileName := lsOut;
|
||||
{ simple. Write to a new file
|
||||
|
@ -414,7 +414,7 @@ begin
|
||||
|
||||
{ files}
|
||||
feBackupMode := TBackupMode(fcReg.ReadInteger(REG_FILES_SECTION,
|
||||
REG_BACKUP_MODE, Ord(cmSeperateOutput)));
|
||||
REG_BACKUP_MODE, Ord(cmSeparateOutput)));
|
||||
feSourceMode := TSourceMode(fcReg.ReadInteger(REG_FILES_SECTION,
|
||||
REG_SOURCE_MODE, Ord(fmSingleFile)));
|
||||
fsInput := fcReg.ReadString(REG_FILES_SECTION, REG_INPUT, '');
|
||||
@ -578,7 +578,7 @@ begin
|
||||
begin
|
||||
Result := '';
|
||||
end
|
||||
else if peMode in [cmInPlaceWithBackup, cmSeperateOutput] then
|
||||
else if peMode in [cmInPlaceWithBackup, cmSeparateOutput] then
|
||||
begin
|
||||
lsExt := ExtractFileExt(psIn);
|
||||
liMainFileNameLength := Length(psIn) - Length(lsExt);
|
||||
|
@ -53,8 +53,8 @@ inherited frBasic: TfrBasic
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'No backup'
|
||||
'Backup to seperate file'
|
||||
'Output to seperate file')
|
||||
'Backup to separate file'
|
||||
'Output to separate file')
|
||||
TabOrder = 1
|
||||
OnClick = rgBackupClick
|
||||
end
|
||||
|
@ -90,7 +90,7 @@ uses
|
||||
{ jcl }
|
||||
jclFileUtils,
|
||||
{ local }
|
||||
JcfFileUtils, JcfHelp, JcfSettings, JcfRegistrySettings;
|
||||
JcfHelp, JcfSettings, JcfRegistrySettings;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$R *.lfm}
|
||||
@ -162,7 +162,7 @@ begin
|
||||
lblOutput.Caption := '';
|
||||
cmInPlaceWithBackup:
|
||||
lblOutput.Caption := 'Backup file';
|
||||
cmSeperateOutput:
|
||||
cmSeparateOutput:
|
||||
lblOutput.Caption := 'Output file';
|
||||
else
|
||||
raise Exception.Create('TfrmMain.DisplayOutputFile: bad backup group index');
|
||||
@ -265,7 +265,7 @@ begin
|
||||
Result := Result + ' in place';
|
||||
cmInPlaceWithBackup:
|
||||
Result := Result + ' with backup';
|
||||
cmSeperateOutput:
|
||||
cmSeparateOutput:
|
||||
Result := Result + ' to output';
|
||||
end;
|
||||
end;
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
|
||||
uses
|
||||
{ delphi }
|
||||
SysUtils, Classes, Controls, Forms, StdCtrls, Graphics,
|
||||
Windows, SysUtils, Classes, Controls, Forms, StdCtrls, Graphics,
|
||||
{ local }
|
||||
frmBaseSettingsFrame, JvMemo, JvExStdCtrls;
|
||||
|
||||
@ -56,10 +56,10 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
{ jcl }
|
||||
JclFileUtils,
|
||||
{ local }
|
||||
JcfFileUtils, JcfRegistrySettings, JcfSettings;
|
||||
{ jcl }
|
||||
JclFileUtils,
|
||||
{ local }
|
||||
JcfRegistrySettings, JcfSettings;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$R *.lfm}
|
||||
|
@ -72,7 +72,7 @@ const
|
||||
implementation
|
||||
|
||||
uses
|
||||
{$ifndef fpc}Windows, JcfFileUtils,{$endif} SysUtils, Forms;
|
||||
{$ifndef fpc} Windows, {$endif} SysUtils, Forms;
|
||||
|
||||
function GetHelpFilePath: string;
|
||||
var
|
||||
|
@ -47,8 +47,7 @@ uses
|
||||
|
||||
procedure SetCaptionFont(const AObjectFont: TFont);
|
||||
begin
|
||||
if IsWinVista then
|
||||
//if IsWinVista or IsWinServer2008 then
|
||||
if IsWinVista or IsWinServer2008 or IsWin7 or IsWinServer2008R2 then
|
||||
begin
|
||||
AObjectFont.Name := 'Segoe UI';
|
||||
AObjectFont.Size := 9;
|
||||
@ -69,8 +68,7 @@ end;
|
||||
|
||||
procedure SetContentFont(const AObjectFont: TFont);
|
||||
begin
|
||||
//if IsWinVista or IsWinServer2008 then
|
||||
if IsWinVista then
|
||||
if IsWinVista or IsWinServer2008 or IsWin7 or IsWinServer2008R2 then
|
||||
begin
|
||||
AObjectFont.Name := 'Calibri';
|
||||
AObjectFont.Size := 9;
|
||||
|
@ -28,8 +28,8 @@ See http://www.gnu.org/licenses/gpl.html
|
||||
{$I JcfGlobal.inc}
|
||||
|
||||
{
|
||||
This unit contains OS/File utility code
|
||||
For use when the JCL functions are not avaialable
|
||||
This unit contains OS and File utility code
|
||||
For use when the JCL functions are not available
|
||||
}
|
||||
interface
|
||||
|
||||
@ -37,11 +37,17 @@ uses
|
||||
SysUtils, Classes;
|
||||
|
||||
function GetWindowsTempFolder: string;
|
||||
|
||||
function FileIsReadOnly(const ps: string): boolean;
|
||||
function FileGetSize(const FileName: string): Int64;
|
||||
|
||||
procedure ShellExecEx(const FileName: string; const Parameters: string = '');
|
||||
function GetTickCount: Cardinal;
|
||||
function IsMultiByte(const pcChar: WideChar): Boolean;
|
||||
|
||||
function IsWinServer2008R2: Boolean;
|
||||
function IsWin7: Boolean;
|
||||
function IsWinServer2008: Boolean;
|
||||
function IsWinVista: Boolean;
|
||||
function IsWinXP: Boolean;
|
||||
function IsWin2k: Boolean;
|
||||
@ -49,16 +55,21 @@ function IsWin2003: Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
// We know that this unit contains platform-specific code
|
||||
// it's guarded by ifdefs
|
||||
{$WARN SYMBOL_PLATFORM OFF}
|
||||
|
||||
uses
|
||||
{$ifdef MSWINDOWS}
|
||||
Windows, ShellApi
|
||||
{$endif}
|
||||
{$ifdef Unix}
|
||||
Unix
|
||||
{$endif}
|
||||
{$ifdef fpc}
|
||||
, LCLIntf, FileUtil
|
||||
{$endif};
|
||||
{$ifdef MSWINDOWS}
|
||||
Windows, ShellApi, {$WARNINGS OFF} FileCtrl {$WARNINGS ON}
|
||||
{$endif}
|
||||
{$ifdef Unix}
|
||||
,Unix,
|
||||
{$endif}
|
||||
{$ifdef fpc}
|
||||
,LCLIntf, FileUtil, Dialogs
|
||||
{$endif}
|
||||
;
|
||||
|
||||
function GetWindowsTempFolder: string;
|
||||
{$ifndef fpc}
|
||||
@ -76,9 +87,38 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
// We know that this unit contains platform-specific code
|
||||
// it's guarded by ifdefs
|
||||
{$WARN SYMBOL_PLATFORM OFF}
|
||||
{$IFDEF FPC}
|
||||
|
||||
// FPC version
|
||||
function FileIsReadOnly(const ps: string): boolean;
|
||||
var
|
||||
liAttr: integer;
|
||||
begin
|
||||
Assert(FileExists(ps));
|
||||
{$WARNINGS OFF}
|
||||
liAttr := FileGetAttr(ps);
|
||||
Result := ((liAttr and faReadOnly) <> 0);
|
||||
{$WARNINGS ON}
|
||||
end;
|
||||
|
||||
{$ELSE}
|
||||
{$IFDEF WIN32}
|
||||
|
||||
// delphi-windows version
|
||||
function FileIsReadOnly(const ps: string): boolean;
|
||||
var
|
||||
liAttr: integer;
|
||||
begin
|
||||
Assert(FileExists(ps));
|
||||
{$WARNINGS OFF}
|
||||
liAttr := FileGetAttr(ps);
|
||||
Result := ((liAttr and faReadOnly) <> 0);
|
||||
{$WARNINGS ON}
|
||||
end;
|
||||
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
function FileGetSize(const FileName: string): Int64;
|
||||
{$ifndef fpc}
|
||||
@ -131,11 +171,41 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function IsWinServer2008R2: Boolean;
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
Result := (Win32MajorVersion = 6) and (Win32MinorVersion = 1);
|
||||
// Should also make sure it's a server (see JclSysInfo)
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function IsWin7: Boolean;
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
Result := (Win32MajorVersion = 6) and (Win32MinorVersion = 1);
|
||||
// Should also make sure it's a workstation (see JclSysInfo)
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function IsWinServer2008: Boolean;
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
Result := (Win32MajorVersion = 6) and (Win32MinorVersion = 0);
|
||||
// Should also make sure it's a server (see JclSysInfo)
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function IsWinVista: Boolean;
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
Result := Win32MajorVersion = 6;
|
||||
// can be also window server 2008
|
||||
Result := (Win32MajorVersion = 6) and (Win32MinorVersion = 0);
|
||||
// Should also make sure it's a workstation (see JclSysInfo)
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
|
@ -1,3 +1,3 @@
|
||||
This directory contains a copy (sometimes modified) of r773 jcf2 svn tree: https://jedicodeformat.svn.sourceforge.net/svnroot/jedicodeformat/trunk/CodeFormat/Jcf2
|
||||
This directory contains a copy (sometimes modified) of r792 jcf2 svn tree: https://jedicodeformat.svn.sourceforge.net/svnroot/jedicodeformat/trunk/CodeFormat/Jcf2
|
||||
|
||||
Only command line utility works currently.
|
Loading…
Reference in New Issue
Block a user