- add JcfUtils unit with almost empty implementation
  - replace usage of Jcl units with JcfUtils.
  - add lazarus project for console jcf application

git-svn-id: trunk@16945 -
This commit is contained in:
paul 2008-10-10 05:33:07 +00:00
parent 1876e1727f
commit 7c0a1d29a9
48 changed files with 1443 additions and 134 deletions

3
.gitattributes vendored
View File

@ -402,6 +402,8 @@ components/jcf2/CommandLine/D11/JCF.dpr svneol=native#text/plain
components/jcf2/CommandLine/D11/jcf.bdsproj svneol=native#text/plain
components/jcf2/CommandLine/D12/JCF.dpr svneol=native#text/plain
components/jcf2/CommandLine/D12/jcf.bdsproj svneol=native#text/plain
components/jcf2/CommandLine/Lazarus/JCF.lpr svneol=native#text/pascal
components/jcf2/CommandLine/Lazarus/jcf.lpi svneol=native#text/xml
components/jcf2/CommandLine/StatusMessageReceiver.pas svneol=native#text/pascal
components/jcf2/CommandLine/jcf.dof svneol=native#text/plain
components/jcf2/Contributions/StyleEditor/JCFStyle.bdsproj svneol=native#text/plain
@ -626,6 +628,7 @@ components/jcf2/Utils/JcfLog.pas svneol=native#text/pascal
components/jcf2/Utils/JcfMiscFunctions.pas svneol=native#text/pascal
components/jcf2/Utils/JcfUnicode.pas svneol=native#text/pascal
components/jcf2/Utils/JcfUnicodeFiles.pas svneol=native#text/pascal
components/jcf2/Utils/JcfUtils.pas svneol=native#text/pascal
components/jcf2/VersionConsts.pas svneol=native#text/pascal
components/jcf2/readme.txt svneol=native#text/plain
components/lazreport/doc/contributors.txt svneol=native#text/plain

View File

@ -1,9 +1,9 @@
unit CommandLineConstants;
interface
{$I JcfGlobal.inc}
uses
JclAnsiStrings,
JcfUtils,
VersionConsts;
const

View File

@ -26,7 +26,7 @@ See http://www.gnu.org/licenses/gpl.html
{*)}
interface
{$I JcfGlobal.inc}
{
command line return code
0 for sucess

View File

@ -0,0 +1,413 @@
program JCF;
{$APPTYPE CONSOLE}
{(*}
(*------------------------------------------------------------------------------
Delphi Code formatter source code
The Original Code is JCF, released May 2003.
The Initial Developer of the Original Code is Anthony Steele.
Portions created by Anthony Steele are Copyright (C) 1999-2008 Anthony Steele.
All Rights Reserved.
Contributor(s): Anthony Steele.
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"). you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and limitations
under the License.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 or later (the "GPL")
See http://www.gnu.org/licenses/gpl.html
------------------------------------------------------------------------------*)
{*)}
{$I JcfGlobal.inc}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms,
SysUtils,
FileCtrl,
JcfUtils in '..\..\Utils\JcfUtils.pas',
Converter in '..\..\ReadWrite\Converter.pas',
FileConverter in '..\..\ReadWrite\FileConverter.pas',
ConvertTypes in '..\..\ReadWrite\ConvertTypes.pas',
BuildParseTree in '..\..\Parse\BuildParseTree.pas',
BuildTokenList in '..\..\Parse\BuildTokenList.pas',
ParseError in '..\..\Parse\ParseError.pas',
ParseTreeNode in '..\..\Parse\ParseTreeNode.pas',
ParseTreeNodeType in '..\..\Parse\ParseTreeNodeType.pas',
SourceToken in '..\..\Parse\SourceToken.pas',
SourceTokenList in '..\..\Parse\SourceTokenList.pas',
VisitSetXY in '..\..\Process\VisitSetXY.pas',
BaseVisitor in '..\..\Process\BaseVisitor.pas',
JcfMiscFunctions in '..\..\Utils\JcfMiscFunctions.pas',
FileUtils in '..\..\Utils\FileUtils.pas',
JcfLog in '..\..\Utils\JcfLog.pas',
fShowParseTree in '..\..\Parse\UI\fShowParseTree.pas' {frmShowParseTree},
SetUses in '..\..\Settings\SetUses.pas',
JCFSetBase in '..\..\Settings\JCFSetBase.pas',
JCFSettings in '..\..\Settings\JCFSettings.pas',
SetAlign in '..\..\Settings\SetAlign.pas',
SetCaps in '..\..\Settings\SetCaps.pas',
SetClarify in '..\..\Settings\SetClarify.pas',
SetFile in '..\..\Settings\SetFile.pas',
SetIndent in '..\..\Settings\SetIndent.pas',
SetObfuscate in '..\..\Settings\SetObfuscate.pas',
SetReplace in '..\..\Settings\SetReplace.pas',
SetReturns in '..\..\Settings\SetReturns.pas',
SetSpaces in '..\..\Settings\SetSpaces.pas',
SettingsStream in '..\..\Settings\Streams\SettingsStream.pas',
RegistrySettings in '..\..\Settings\Streams\RegistrySettings.pas',
RemoveUnneededWhiteSpace in '..\..\Process\Obfuscate\RemoveUnneededWhiteSpace.pas',
FixCase in '..\..\Process\Obfuscate\FixCase.pas',
RebreakLines in '..\..\Process\Obfuscate\RebreakLines.pas',
ReduceWhiteSpace in '..\..\Process\Obfuscate\ReduceWhiteSpace.pas',
RemoveComment in '..\..\Process\Obfuscate\RemoveComment.pas',
RemoveConsecutiveWhiteSpace in '..\..\Process\Obfuscate\RemoveConsecutiveWhiteSpace.pas',
RemoveReturn in '..\..\Process\Obfuscate\RemoveReturn.pas',
WarnRealType in '..\..\Process\Warnings\WarnRealType.pas',
WarnAssignToFunctionName in '..\..\Process\Warnings\WarnAssignToFunctionName.pas',
WarnCaseNoElse in '..\..\Process\Warnings\WarnCaseNoElse.pas',
WarnDestroy in '..\..\Process\Warnings\WarnDestroy.pas',
WarnEmptyBlock in '..\..\Process\Warnings\WarnEmptyBlock.pas',
Warning in '..\..\Process\Warnings\Warning.pas',
VersionConsts in '..\..\VersionConsts.pas',
JcfRegistrySettings in '..\..\Settings\JcfRegistrySettings.pas',
TokenUtils in '..\..\Parse\TokenUtils.pas',
NoSpaceBefore in '..\..\Process\Spacing\NoSpaceBefore.pas',
NoSpaceAfter in '..\..\Process\Spacing\NoSpaceAfter.pas',
SingleSpaceAfter in '..\..\Process\Spacing\SingleSpaceAfter.pas',
SingleSpaceBefore in '..\..\Process\Spacing\SingleSpaceBefore.pas',
ReturnAfter in '..\..\Process\Returns\ReturnAfter.pas',
Nesting in '..\..\Process\Nesting.pas',
VisitSetNesting in '..\..\Process\VisitSetNesting.pas',
ReturnBefore in '..\..\Process\Returns\ReturnBefore.pas',
NoReturnAfter in '..\..\Process\Returns\NoReturnAfter.pas',
NoReturnBefore in '..\..\Process\Returns\NoReturnBefore.pas',
AllProcesses in '..\..\Process\AllProcesses.pas',
RemoveBlankLine in '..\..\Process\Obfuscate\RemoveBlankLine.pas',
BlockStyles in '..\..\Process\Returns\BlockStyles.pas',
SwitchableVisitor in '..\..\Process\SwitchableVisitor.pas',
FormatFlags in '..\..\Process\FormatFlags.pas',
TabToSpace in '..\..\Process\Spacing\TabToSpace.pas',
SpaceToTab in '..\..\Process\Spacing\SpaceToTab.pas',
SpecificWordCaps in '..\..\Process\Capitalisation\SpecificWordCaps.pas',
Capitalisation in '..\..\Process\Capitalisation\Capitalisation.pas',
Indenter in '..\..\Process\Indent\Indenter.pas',
PropertyOnOneLine in '..\..\Process\Returns\PropertyOnOneLine.pas',
SpaceBeforeColon in '..\..\Process\Spacing\SpaceBeforeColon.pas',
VisitStripEmptySpace in '..\..\Process\VisitStripEmptySpace.pas',
RemoveBlankLinesAfterProcHeader in '..\..\Process\Returns\RemoveBlankLinesAfterProcHeader.pas',
RemoveBlankLinesInVars in '..\..\Process\Returns\RemoveBlankLinesInVars.pas',
ReturnChars in '..\..\Process\Returns\ReturnChars.pas',
RemoveReturnsBeforeEnd in '..\..\Process\Returns\RemoveReturnsBeforeEnd.pas',
RemoveReturnsAfterBegin in '..\..\Process\Returns\RemoveReturnsAfterBegin.pas',
LongLineBreaker in '..\..\Process\Returns\LongLineBreaker.pas',
IntList in '..\..\Utils\IntList.pas',
BasicStats in '..\..\Process\Info\BasicStats.pas',
AlignConst in '..\..\Process\Align\AlignConst.pas',
AlignBase in '..\..\Process\Align\AlignBase.pas',
AlignAssign in '..\..\Process\Align\AlignAssign.pas',
AlignVars in '..\..\Process\Align\AlignVars.pas',
AlignTypedef in '..\..\Process\Align\AlignTypedef.pas',
AlignComment in '..\..\Process\Align\AlignComment.pas',
Tokens in '..\..\Parse\Tokens.pas',
SetWordList in '..\..\Settings\SetWordList.pas',
PreProcessorExpressionTokens in '..\..\Parse\PreProcessor\PreProcessorExpressionTokens.pas',
PreProcessorExpressionParser in '..\..\Parse\PreProcessor\PreProcessorExpressionParser.pas',
PreProcessorExpressionTokenise in '..\..\Parse\PreProcessor\PreProcessorExpressionTokenise.pas',
JCFHelp in '..\..\Utils\JCFHelp.pas',
SettingsTypes in '..\..\Settings\SettingsTypes.pas',
SetPreProcessor in '..\..\Settings\SetPreProcessor.pas',
UnitNameCaps in '..\..\Process\Capitalisation\UnitNameCaps.pas',
RemoveSpaceAtLineEnd in '..\..\Process\Spacing\RemoveSpaceAtLineEnd.pas',
FindReplace in '..\..\Process\Transform\FindReplace.pas',
fJcfErrorDisplay in '..\..\Ui\fJcfErrorDisplay.pas' {ExceptionDialog},
ReturnsAfterFinalEnd in '..\..\Process\Returns\ReturnsAfterFinalEnd.pas',
PreProcessorParseTree in '..\..\Parse\PreProcessor\PreProcessorParseTree.pas',
RemoveEmptyComment in '..\..\Process\RemoveEmptyComment.pas',
RemoveConsecutiveReturns in '..\..\Process\Returns\RemoveConsecutiveReturns.pas',
UsesClauseFindReplace in '..\..\Process\Transform\UsesClauseFindReplace.pas',
UsesClauseInsert in '..\..\Process\Transform\UsesClauseInsert.pas',
UsesClauseRemove in '..\..\Process\Transform\UsesClauseRemove.pas',
MaxSpaces in '..\..\Process\Spacing\MaxSpaces.pas',
SetComments in '..\..\Settings\SetComments.pas',
TreeWalker in '..\..\Process\TreeWalker.pas',
AddBlockEndSemicolon in '..\..\Process\Transform\AddBlockEndSemicolon.pas',
AddBeginEnd in '..\..\Process\Transform\AddBeginEnd.pas',
SetTransform in '..\..\Settings\SetTransform.pas',
AlignField in '..\..\Process\Align\AlignField.pas',
SortUses in '..\..\Process\Transform\SortUses.pas',
SortUsesData in '..\..\Process\Transform\SortUsesData.pas',
IdentifierCaps in '..\..\Process\Capitalisation\IdentifierCaps.pas',
WarnUnusedParam in '..\..\Process\Warnings\WarnUnusedParam.pas',
JcfFontSetFunctions in '..\..\Utils\JcfFontSetFunctions.pas',
SetAsm in '..\..\Settings\SetAsm.pas',
RemoveReturnsAfter in '..\..\Process\Returns\RemoveReturnsAfter.pas',
IndentAsmParam in '..\..\Process\Indent\IndentAsmParam.pas',
AsmKeywords in '..\..\Parse\AsmKeywords.pas',
JcfUnicode in '..\..\Utils\JcfUnicode.pas',
JcfUnicodeFiles in '..\..\Utils\JcfUnicodeFiles.pas',
CommandLineReturnCode in '..\CommandLineReturnCode.pas',
CommandLineConstants in '..\CommandLineConstants.pas',
StatusMessageReceiver in '..\StatusMessageReceiver.pas';
var
feReturnCode: TJcfCommandLineReturnCode;
fbCmdLineShowHelp: boolean;
fbQuietFail: boolean;
fbCmdLineObfuscate: boolean;
fbHasSourceMode: boolean;
feCmdLineSourceMode: TSourceMode;
fbHasBackupMode: boolean;
feCmdLineBackupMode: TBackupMode;
fbYesAll: boolean;
fbHasNamedConfigFile: boolean;
fsConfigFileName: string;
lcStatus: TStatusMesssageReceiver;
function StripParamPrefix(const ps: string): string;
begin
Result := ps;
if StrLeft(Result, 1) = '/' then
Result := StrRestOf(Result, 2);
if StrLeft(ps, 1) = '\' then
Result := StrRestOf(Result, 2);
if StrLeft(Result, 1) = '-' then
Result := StrRestOf(Result, 2);
end;
procedure ParseCommandLine;
var
liLoop: integer;
lsOpt: string;
lsPath: string;
begin
fbCmdLineShowHelp := (ParamCount = 0);
fbQuietFail := False;
fbCmdLineObfuscate := False;
fbHasSourceMode := False;
fbHasBackupMode := False;
fbYesAll := False;
fbHasNamedConfigFile := False;
fsConfigFileName := '';
for liLoop := 1 to ParamCount do
begin
{ look for something that is not a -/\ param }
lsOpt := ParamStr(liLoop);
if (StrLeft(lsOpt, 1) <> '-') and (StrLeft(lsOpt, 1) <> '/') and
(StrLeft(lsOpt, 1) <> '\') and (StrLeft(lsOpt, 1) <> '?') then
begin
// must be a path
lsPath := StrTrimQuotes(lsOpt);
continue;
end;
lsOpt := StripParamPrefix(lsOpt);
if lsOpt = '?' then
begin
fbCmdLineShowHelp := True;
break;
end
else if AnsiSameText(lsOpt, 'obfuscate') then
begin
fbCmdLineObfuscate := True;
end
else if AnsiSameText(lsOpt, 'clarify') then
begin
fbCmdLineObfuscate := False;
end
else if AnsiSameText(lsOpt, 'inplace') then
begin
fbHasBackupMode := True;
feCmdLineBackupMode := cmInPlace;
end
else if AnsiSameText(lsOpt, 'out') then
begin
fbHasBackupMode := True;
feCmdLineBackupMode := cmSeperateOutput;
end
else if AnsiSameText(lsOpt, 'backup') then
begin
fbHasBackupMode := True;
feCmdLineBackupMode := cmInPlaceWithBackup;
end
else if AnsiSameText(lsOpt, 'f') then
begin
fbHasSourceMode := True;
feCmdLineSourceMode := fmSingleFile;
end
else if AnsiSameText(lsOpt, 'd') then
begin
fbHasSourceMode := True;
feCmdLineSourceMode := fmDirectory;
end
else if AnsiSameText(lsOpt, 'r') then
begin
fbHasSourceMode := True;
feCmdLineSourceMode := fmDirectoryRecursive;
end
else if AnsiSameText(lsOpt, 'y') then
begin
fbYesAll := True;
end
else if StrFind('config', lsOpt) = 1 then
begin
fbHasNamedConfigFile := True;
fsConfigFileName := StrAfter('=', lsOpt);
end
else
begin
WriteLn('Unknown option ' + StrDoubleQuote(lsOpt));
WriteLn;
fbCmdLineShowHelp := True;
break;
end;
end; // for loop
if lsPath = '' then
begin
WriteLn('No path found');
WriteLn;
fbCmdLineShowHelp := True;
feReturnCode := rcNoPathFound;
end;
{ read settings from file? }
if fbHasNamedConfigFile and (fsConfigFileName <> '') then
begin
if FileExists(fsConfigFileName) then
begin
FormatSettingsFromFile(fsConfigFileName);
end
else
begin
WriteLn('Named config file ' + fsConfigFileName + ' was not found');
WriteLn;
fbQuietFail := True;
feReturnCode := rcConfigFileNotFound;
end
end;
{ must have read from registry or file }
if (not FormatSettings.HasRead) and (not fbQuietFail) then
begin
WriteLn('No settings to read');
WriteLn;
fbQuietFail := True;
if feReturnCode = rcSuccess then
begin
feReturnCode := rcSettingsNotRead;
end;
end;
{ write to settings }
if fbHasSourceMode then
GetRegSettings.SourceMode := feCmdLineSourceMode;
if fbHasBackupMode then
GetRegSettings.BackupMode := feCmdLineBackupMode;
if not fbCmdLineShowHelp then
begin
if GetRegSettings.SourceMode = fmSingleFile then
begin
if not FileExists(lsPath) then
begin
WriteLn('File ' + StrDoubleQuote(lsPath) + ' not found');
fbQuietFail := True;
feReturnCode := rcFileNotFound;
end;
end
else
begin
if not DirectoryExists(lsPath) then
begin
WriteLn('Directory ' + StrDoubleQuote(lsPath) + ' not found');
fbQuietFail := True;
feReturnCode := rcDirectoryNotFound;
end;
end;
end;
GetRegSettings.Input := lsPath;
FormatSettings.Obfuscate.Enabled := fbCmdLineObfuscate;
end;
procedure ConvertFiles;
var
lcConvert: TFileConverter;
begin
lcConvert := TFileConverter.Create;
try
lcConvert.OnStatusMessage := lcStatus.OnReceiveStatusMessage;
// use command line settings
lcConvert.YesAll := fbYesAll;
lcConvert.GuiMessages := False;
lcConvert.SourceMode := GetRegSettings.SourceMode;
lcConvert.BackupMode := GetRegSettings.BackupMode;
lcConvert.Input := GetRegSettings.Input;
// do it!
lcConvert.Convert;
if lcConvert.ConvertError then
begin
feReturnCode := rcConvertError;
end;
finally
lcConvert.Free;
end;
end;
{ main program starts here }
begin
feReturnCode := rcSuccess;
{ read registry }
GetRegSettings.ReadAll;
lcStatus := TStatusMesssageReceiver.Create;
ParseCommandLine;
{ format setttings will be altered by the command line.
Do not persist these changes
do this after parsing the command line }
FormatSettings.WriteOnExit := False;
if fbQuietFail then
begin
// do nothing
end
else if fbCmdLineShowHelp then
begin
WriteLn(ABOUT_COMMANDLINE);
end
else
begin
ConvertFiles;
end;
FreeAndNil(lcStatus);
HaltOnError(feReturnCode);
end.

View File

@ -0,0 +1,574 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="56">
<Unit0>
<Filename Value="JCF.lpr"/>
<IsPartOfProject Value="True"/>
<CursorPos X="45" Y="36"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="68"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\..\laz_svn\0.9.25\fpc_bad_test\test.pp"/>
<UnitName Value="test"/>
<CursorPos X="17" Y="6"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit1>
<Unit2>
<Filename Value="..\Include\JcfGlobal.inc"/>
<CursorPos X="1" Y="4"/>
<TopLine Value="1"/>
<UsageCount Value="8"/>
</Unit2>
<Unit3>
<Filename Value="..\Settings\JcfRegistrySettings.pas"/>
<UnitName Value="JcfRegistrySettings"/>
<CursorPos X="41" Y="251"/>
<TopLine Value="230"/>
<UsageCount Value="8"/>
</Unit3>
<Unit4>
<Filename Value="..\ReadWrite\ConvertTypes.pas"/>
<UnitName Value="ConvertTypes"/>
<CursorPos X="78" Y="67"/>
<TopLine Value="47"/>
<UsageCount Value="8"/>
</Unit4>
<Unit5>
<Filename Value="..\Utils\FileUtils.pas"/>
<UnitName Value="FileUtils"/>
<CursorPos X="1" Y="63"/>
<TopLine Value="57"/>
<UsageCount Value="8"/>
</Unit5>
<Unit6>
<Filename Value="..\Ui\fJcfErrorDisplay.pas"/>
<ComponentName Value="ExceptionDialog"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="..\Ui\fJcfErrorDisplay.lrs"/>
<UnitName Value="fJcfErrorDisplay"/>
<CursorPos X="44" Y="64"/>
<TopLine Value="49"/>
<UsageCount Value="8"/>
</Unit6>
<Unit7>
<Filename Value="..\Parse\UI\fShowParseTree.pas"/>
<ComponentName Value="frmShowParseTree"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="..\Parse\UI\fShowParseTree.lrs"/>
<UnitName Value="fShowParseTree"/>
<CursorPos X="99" Y="296"/>
<TopLine Value="282"/>
<UsageCount Value="7"/>
</Unit7>
<Unit8>
<Filename Value="..\..\Parse\Tokens.pas"/>
<UnitName Value="Tokens"/>
<CursorPos X="1" Y="464"/>
<TopLine Value="446"/>
<UsageCount Value="6"/>
</Unit8>
<Unit9>
<Filename Value="..\..\Utils\JcfUnicode.pas"/>
<UnitName Value="JcfUnicode"/>
<CursorPos X="11" Y="76"/>
<TopLine Value="46"/>
<UsageCount Value="6"/>
</Unit9>
<Unit10>
<Filename Value="..\..\Utils\JcfMiscFunctions.pas"/>
<UnitName Value="JcfMiscFunctions"/>
<CursorPos X="5" Y="87"/>
<TopLine Value="64"/>
<UsageCount Value="6"/>
</Unit10>
<Unit11>
<Filename Value="..\..\Parse\BuildTokenList.pas"/>
<UnitName Value="BuildTokenList"/>
<CursorPos X="10" Y="108"/>
<TopLine Value="79"/>
<UsageCount Value="6"/>
</Unit11>
<Unit12>
<Filename Value="..\..\Settings\JcfRegistrySettings.pas"/>
<UnitName Value="JCFRegistrySettings"/>
<CursorPos X="23" Y="585"/>
<TopLine Value="567"/>
<UsageCount Value="6"/>
<Bookmarks Count="1">
<Item0 X="16" Y="525" ID="1"/>
</Bookmarks>
</Unit12>
<Unit13>
<Filename Value="..\..\Utils\JcfUtils.pas"/>
<UnitName Value="JcfUtils"/>
<CursorPos X="76" Y="302"/>
<TopLine Value="271"/>
<UsageCount Value="6"/>
</Unit13>
<Unit14>
<Filename Value="..\..\Settings\SettingsTypes.pas"/>
<UnitName Value="SettingsTypes"/>
<CursorPos X="1" Y="2"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit14>
<Unit15>
<Filename Value="..\..\Parse\TokenUtils.pas"/>
<UnitName Value="TokenUtils"/>
<CursorPos X="8" Y="177"/>
<TopLine Value="166"/>
<UsageCount Value="6"/>
</Unit15>
<Unit16>
<Filename Value="..\..\Settings\Streams\SettingsStream.pas"/>
<UnitName Value="SettingsStream"/>
<CursorPos X="13" Y="160"/>
<TopLine Value="136"/>
<UsageCount Value="6"/>
</Unit16>
<Unit17>
<Filename Value="..\..\Settings\SetClarify.pas"/>
<UnitName Value="SetClarify"/>
<CursorPos X="11" Y="75"/>
<TopLine Value="42"/>
<UsageCount Value="6"/>
</Unit17>
<Unit18>
<Filename Value="..\..\Settings\SetReplace.pas"/>
<UnitName Value="SetReplace"/>
<CursorPos X="20" Y="72"/>
<TopLine Value="53"/>
<UsageCount Value="6"/>
</Unit18>
<Unit19>
<Filename Value="..\..\VersionConsts.pas"/>
<UnitName Value="VersionConsts"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit19>
<Unit20>
<Filename Value="..\..\Settings\JCFSettings.pas"/>
<UnitName Value="JCFSettings"/>
<CursorPos X="1" Y="140"/>
<TopLine Value="111"/>
<UsageCount Value="6"/>
</Unit20>
<Unit21>
<Filename Value="..\..\Parse\AsmKeywords.pas"/>
<UnitName Value="AsmKeywords"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit21>
<Unit22>
<Filename Value="..\..\Parse\BuildParseTree.pas"/>
<UnitName Value="BuildParseTree"/>
<CursorPos X="1" Y="289"/>
<TopLine Value="259"/>
<UsageCount Value="6"/>
</Unit22>
<Unit23>
<Filename Value="..\..\Process\BaseVisitor.pas"/>
<UnitName Value="BaseVisitor"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit23>
<Unit24>
<Filename Value="..\..\ReadWrite\Converter.pas"/>
<UnitName Value="Converter"/>
<CursorPos X="40" Y="422"/>
<TopLine Value="392"/>
<UsageCount Value="6"/>
</Unit24>
<Unit25>
<Filename Value="..\..\Utils\JcfFontSetFunctions.pas"/>
<UnitName Value="JcfFontSetFunctions"/>
<CursorPos X="92" Y="109"/>
<TopLine Value="91"/>
<UsageCount Value="6"/>
</Unit25>
<Unit26>
<Filename Value="..\..\Parse\UI\fShowParseTree.pas"/>
<ComponentName Value="frmShowParseTree"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="..\..\Parse\UI\fShowParseTree.lrs"/>
<UnitName Value="fShowParseTree"/>
<CursorPos X="6" Y="92"/>
<TopLine Value="73"/>
<UsageCount Value="6"/>
<Bookmarks Count="1">
<Item0 X="7" Y="331" ID="1"/>
</Bookmarks>
</Unit26>
<Unit27>
<Filename Value="..\..\Process\VisitSetXY.pas"/>
<UnitName Value="VisitSetXY"/>
<CursorPos X="11" Y="52"/>
<TopLine Value="34"/>
<UsageCount Value="6"/>
</Unit27>
<Unit28>
<Filename Value="..\..\Process\FormatFlags.pas"/>
<UnitName Value="FormatFlags"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit28>
<Unit29>
<Filename Value="..\..\Process\Obfuscate\FixCase.pas"/>
<UnitName Value="FixCase"/>
<CursorPos X="13" Y="51"/>
<TopLine Value="33"/>
<UsageCount Value="6"/>
</Unit29>
<Unit30>
<Filename Value="..\..\Process\Obfuscate\RemoveComment.pas"/>
<UnitName Value="RemoveComment"/>
<CursorPos X="13" Y="52"/>
<TopLine Value="33"/>
<UsageCount Value="6"/>
</Unit30>
<Unit31>
<Filename Value="..\..\Process\Obfuscate\RemoveUnneededWhiteSpace.pas"/>
<UnitName Value="RemoveUnneededWhiteSpace"/>
<CursorPos X="11" Y="51"/>
<TopLine Value="31"/>
<UsageCount Value="6"/>
</Unit31>
<Unit32>
<Filename Value="..\..\Process\Obfuscate\RemoveReturn.pas"/>
<UnitName Value="RemoveReturn"/>
<CursorPos X="3" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="6"/>
</Unit32>
<Unit33>
<Filename Value="..\..\Process\Obfuscate\RebreakLines.pas"/>
<UnitName Value="RebreakLines"/>
<CursorPos X="11" Y="53"/>
<TopLine Value="31"/>
<UsageCount Value="6"/>
</Unit33>
<Unit34>
<Filename Value="..\..\Process\RemoveEmptyComment.pas"/>
<UnitName Value="RemoveEmptyComment"/>
<CursorPos X="34" Y="88"/>
<TopLine Value="70"/>
<UsageCount Value="6"/>
</Unit34>
<Unit35>
<Filename Value="..\..\Process\Capitalisation\IdentifierCaps.pas"/>
<UnitName Value="IdentifierCaps"/>
<CursorPos X="11" Y="61"/>
<TopLine Value="34"/>
<UsageCount Value="6"/>
</Unit35>
<Unit36>
<Filename Value="..\..\Process\Capitalisation\Capitalisation.pas"/>
<UnitName Value="Capitalisation"/>
<CursorPos X="33" Y="80"/>
<TopLine Value="62"/>
<UsageCount Value="30"/>
</Unit36>
<Unit37>
<Filename Value="..\..\Process\Returns\ReturnChars.pas"/>
<UnitName Value="ReturnChars"/>
<CursorPos X="8" Y="48"/>
<TopLine Value="28"/>
<UsageCount Value="30"/>
</Unit37>
<Unit38>
<Filename Value="..\..\Process\Returns\BlockStyles.pas"/>
<UnitName Value="BlockStyles"/>
<CursorPos X="11" Y="86"/>
<TopLine Value="55"/>
<UsageCount Value="30"/>
</Unit38>
<Unit39>
<Filename Value="..\..\Process\Spacing\TabToSpace.pas"/>
<UnitName Value="TabToSpace"/>
<CursorPos X="13" Y="55"/>
<TopLine Value="25"/>
<UsageCount Value="30"/>
</Unit39>
<Unit40>
<Filename Value="..\..\Process\Spacing\SpaceToTab.pas"/>
<UnitName Value="SpaceToTab"/>
<CursorPos X="11" Y="55"/>
<TopLine Value="20"/>
<UsageCount Value="30"/>
</Unit40>
<Unit41>
<Filename Value="..\..\Process\Spacing\MaxSpaces.pas"/>
<UnitName Value="MaxSpaces"/>
<CursorPos X="13" Y="54"/>
<TopLine Value="44"/>
<UsageCount Value="30"/>
</Unit41>
<Unit42>
<Filename Value="..\..\Process\Spacing\SingleSpaceBefore.pas"/>
<UnitName Value="SingleSpaceBefore"/>
<CursorPos X="11" Y="60"/>
<TopLine Value="37"/>
<UsageCount Value="30"/>
</Unit42>
<Unit43>
<Filename Value="..\..\Process\Spacing\SingleSpaceAfter.pas"/>
<UnitName Value="SingleSpaceAfter"/>
<CursorPos X="8" Y="339"/>
<TopLine Value="304"/>
<UsageCount Value="30"/>
</Unit43>
<Unit44>
<Filename Value="..\..\Process\Spacing\SpaceBeforeColon.pas"/>
<UnitName Value="SpaceBeforeColon"/>
<CursorPos X="36" Y="170"/>
<TopLine Value="152"/>
<UsageCount Value="30"/>
</Unit44>
<Unit45>
<Filename Value="..\..\Process\Indent\Indenter.pas"/>
<UnitName Value="Indenter"/>
<CursorPos X="19" Y="647"/>
<TopLine Value="629"/>
<UsageCount Value="30"/>
</Unit45>
<Unit46>
<Filename Value="..\..\Process\Returns\LongLineBreaker.pas"/>
<UnitName Value="LongLineBreaker"/>
<CursorPos X="11" Y="68"/>
<TopLine Value="37"/>
<UsageCount Value="30"/>
</Unit46>
<Unit47>
<Filename Value="..\..\Process\Info\BasicStats.pas"/>
<UnitName Value="BasicStats"/>
<CursorPos X="36" Y="176"/>
<TopLine Value="158"/>
<UsageCount Value="30"/>
</Unit47>
<Unit48>
<Filename Value="..\..\Parse\PreProcessor\PreProcessorExpressionTokens.pas"/>
<UnitName Value="PreProcessorExpressionTokens"/>
<CursorPos X="22" Y="30"/>
<TopLine Value="13"/>
<UsageCount Value="30"/>
</Unit48>
<Unit49>
<Filename Value="..\..\Parse\PreProcessor\PreProcessorExpressionTokenise.pas"/>
<UnitName Value="PreProcessorExpressionTokenise"/>
<CursorPos X="34" Y="97"/>
<TopLine Value="79"/>
<UsageCount Value="30"/>
</Unit49>
<Unit50>
<Filename Value="..\..\ReadWrite\FileConverter.pas"/>
<UnitName Value="FileConverter"/>
<CursorPos X="21" Y="116"/>
<TopLine Value="91"/>
<UsageCount Value="30"/>
</Unit50>
<Unit51>
<Filename Value="..\..\Utils\JcfUnicodeFiles.pas"/>
<UnitName Value="JcfUnicodeFiles"/>
<CursorPos X="5" Y="28"/>
<TopLine Value="10"/>
<UsageCount Value="30"/>
</Unit51>
<Unit52>
<Filename Value="..\..\Ui\fJcfErrorDisplay.pas"/>
<ComponentName Value="ExceptionDialog"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="..\..\Ui\fJcfErrorDisplay.lrs"/>
<UnitName Value="fJcfErrorDisplay"/>
<CursorPos X="14" Y="39"/>
<TopLine Value="26"/>
<UsageCount Value="30"/>
</Unit52>
<Unit53>
<Filename Value="..\CommandLineConstants.pas"/>
<UnitName Value="CommandLineConstants"/>
<CursorPos X="19" Y="4"/>
<TopLine Value="1"/>
<UsageCount Value="29"/>
</Unit53>
<Unit54>
<Filename Value="..\StatusMessageReceiver.pas"/>
<UnitName Value="StatusMessageReceiver"/>
<CursorPos X="19" Y="4"/>
<TopLine Value="1"/>
<UsageCount Value="29"/>
<Bookmarks Count="1">
<Item0 X="8" Y="4" ID="1"/>
</Bookmarks>
</Unit54>
<Unit55>
<Filename Value="..\CommandLineReturnCode.pas"/>
<UnitName Value="CommandLineReturnCode"/>
<CursorPos X="19" Y="29"/>
<TopLine Value="15"/>
<UsageCount Value="29"/>
</Unit55>
</Units>
<JumpHistory Count="25" HistoryIndex="24">
<Position1>
<Filename Value="JCF.lpr"/>
<Caret Line="70" Column="8" TopLine="44"/>
</Position1>
<Position2>
<Filename Value="JCF.lpr"/>
<Caret Line="366" Column="60" TopLine="352"/>
</Position2>
<Position3>
<Filename Value="JCF.lpr"/>
<Caret Line="327" Column="60" TopLine="292"/>
</Position3>
<Position4>
<Filename Value="JCF.lpr"/>
<Caret Line="159" Column="14" TopLine="145"/>
</Position4>
<Position5>
<Filename Value="JCF.lpr"/>
<Caret Line="160" Column="8" TopLine="145"/>
</Position5>
<Position6>
<Filename Value="JCF.lpr"/>
<Caret Line="161" Column="11" TopLine="145"/>
</Position6>
<Position7>
<Filename Value="JCF.lpr"/>
<Caret Line="366" Column="67" TopLine="348"/>
</Position7>
<Position8>
<Filename Value="JCF.lpr"/>
<Caret Line="169" Column="19" TopLine="151"/>
</Position8>
<Position9>
<Filename Value="JCF.lpr"/>
<Caret Line="205" Column="21" TopLine="187"/>
</Position9>
<Position10>
<Filename Value="JCF.lpr"/>
<Caret Line="235" Column="25" TopLine="217"/>
</Position10>
<Position11>
<Filename Value="JCF.lpr"/>
<Caret Line="240" Column="1" TopLine="222"/>
</Position11>
<Position12>
<Filename Value="JCF.lpr"/>
<Caret Line="31" Column="64" TopLine="13"/>
</Position12>
<Position13>
<Filename Value="JCF.lpr"/>
<Caret Line="169" Column="19" TopLine="151"/>
</Position13>
<Position14>
<Filename Value="JCF.lpr"/>
<Caret Line="205" Column="21" TopLine="187"/>
</Position14>
<Position15>
<Filename Value="JCF.lpr"/>
<Caret Line="235" Column="25" TopLine="217"/>
</Position15>
<Position16>
<Filename Value="JCF.lpr"/>
<Caret Line="240" Column="25" TopLine="222"/>
</Position16>
<Position17>
<Filename Value="JCF.lpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position17>
<Position18>
<Filename Value="JCF.lpr"/>
<Caret Line="169" Column="19" TopLine="151"/>
</Position18>
<Position19>
<Filename Value="JCF.lpr"/>
<Caret Line="205" Column="21" TopLine="187"/>
</Position19>
<Position20>
<Filename Value="JCF.lpr"/>
<Caret Line="235" Column="25" TopLine="217"/>
</Position20>
<Position21>
<Filename Value="JCF.lpr"/>
<Caret Line="240" Column="25" TopLine="222"/>
</Position21>
<Position22>
<Filename Value="JCF.lpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position22>
<Position23>
<Filename Value="JCF.lpr"/>
<Caret Line="169" Column="1" TopLine="151"/>
</Position23>
<Position24>
<Filename Value="JCF.lpr"/>
<Caret Line="204" Column="1" TopLine="186"/>
</Position24>
<Position25>
<Filename Value="JCF.lpr"/>
<Caret Line="233" Column="1" TopLine="215"/>
</Position25>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\Include\"/>
<OtherUnitFiles Value="..\..\Output\"/>
<UnitOutputDirectory Value="..\..\Output"/>
<SrcPath Value="..\..\Include\"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View File

@ -1,7 +1,7 @@
unit StatusMessageReceiver;
interface
{$I JcfGlobal.inc}
uses
ConvertTypes;

View File

@ -285,8 +285,7 @@ uses
{ delphi }
SysUtils, Forms,
{ jcl }
JclStrings,
JclAnsiStrings,
JcfUtils,
JcfUnicode;
const
@ -5278,7 +5277,7 @@ begin
{ all kinds of reserved words can sometimes be param names
thanks to COM and named params
See LittleTest43.pas }
if ( not (lc.TokenType in EXPR_TYPES)) and JclStrings.StrIsAlphaNum(lc.SourceCode) and
if ( not (lc.TokenType in EXPR_TYPES)) and JcfUtils.StrIsAlphaNum(lc.SourceCode) and
( not IsIdentifierToken(lc, idAllowDirectives)) then
begin
{ TridenT - test if token is the Reserved word ARRAY

View File

@ -104,8 +104,8 @@ implementation
uses
{ delphi }
Forms, SysUtils,
{ jcl }
JclAnsiStrings, JcfUnicode,
{ jcf }
JcfUtils, JcfUnicode,
{ local }
JcfRegistrySettings;

View File

@ -72,7 +72,7 @@ uses
{ delphi }
SysUtils, Windows,
{ jcl }
JclStrings, JclAnsiStrings;
JcfUtils;
constructor TPreProcessorExpressionTokeniser.Create;
@ -94,7 +94,7 @@ end;
function TPreProcessorExpressionTokeniser.StartsWith(const ps: string): boolean;
begin
Result := AnsiSameText(JclStrings.StrLeft(Rest, Length(ps)), ps);
Result := AnsiSameText(JcfUtils.StrLeft(Rest, Length(ps)), ps);
end;
procedure TPreProcessorExpressionTokeniser.Tokenise;

View File

@ -174,8 +174,8 @@ implementation
uses
{ delphi }
SysUtils, Windows,
{ jcl }
JclStrings, JclAnsiStrings,
{ jcf }
JcfUtils,
{ local }
ParseTreeNodeType, Tokens, Nesting,
JcfSettings, JcfUnicode,
@ -746,7 +746,7 @@ begin
Result := (pt.TokenType in DIRECTIVE_IDENTIFIER_NAMES);
idAny:
// accept any textual token
Result := JclStrings.StrIsAlpha(pt.SourceCode);
Result := JcfUtils.StrIsAlpha(pt.SourceCode);
else
begin
Result := False;
@ -766,7 +766,7 @@ end;
function IsSymbolOperator(const pt: TSourceToken): boolean;
begin
Result := (pt.TokenType in Operators) and (not JclStrings.StrIsAlpha(pt.SourceCode));
Result := (pt.TokenType in Operators) and (not JcfUtils.StrIsAlpha(pt.SourceCode));
end;
function IsClassDirective(const pt: TSourceToken): boolean;

View File

@ -460,8 +460,7 @@ implementation
uses
SysUtils,
Windows,
JclStrings,
JclAnsiStrings,
JcfUtils,
JcfUnicode;
{ the majority of these tokens have a fixed textual representation
@ -1038,7 +1037,7 @@ begin
continue;
liItemLen := Length(PreProcessorSymbolData[leLoop]);
if AnsiSameText(JclStrings.StrLeft(psSourceCode, liItemLen), PreProcessorSymbolData[leLoop]) and
if AnsiSameText(JcfUtils.StrLeft(psSourceCode, liItemLen), PreProcessorSymbolData[leLoop]) and
( not WideCharIsAlpha(psSourceCode[liItemLen + 1])) then
begin
peSymbolType := leLoop;
@ -1049,12 +1048,12 @@ begin
if peSymbolType = ppNone then
exit;
psText := JclStrings.StrRestOf(psSourceCode, Length(PreProcessorSymbolData[peSymbolType]) + 1);
psText := JcfUtils.StrRestOf(psSourceCode, Length(PreProcessorSymbolData[peSymbolType]) + 1);
if psText <> '' then
begin
if JclStrings.StrRight(psText, 1) = '}' then
psText := JclStrings.StrChopRight(psText, 1);
if JcfUtils.StrRight(psText, 1) = '}' then
psText := JcfUtils.StrChopRight(psText, 1);
psText := Trim(psText);
end;

View File

@ -3,8 +3,6 @@ object frmShowParseTree: TfrmShowParseTree
Height = 555
Top = 116
Width = 581
HorzScrollBar.Page = 580
VertScrollBar.Page = 554
ActiveControl = pcPages
BorderIcons = [biSystemMenu, biMaximize]
Caption = 'JCF Parse Tree'
@ -17,8 +15,9 @@ object frmShowParseTree: TfrmShowParseTree
OnCreate = FormCreate
OnKeyUp = FormKeyUp
OnShow = FormShow
ParentFont = False
Position = poOwnerFormCenter
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object StatusBar1: TStatusBar
Height = 23
Top = 532
@ -37,25 +36,25 @@ object frmShowParseTree: TfrmShowParseTree
TabOrder = 1
object lblTreeCount: TLabel
Left = 11
Height = 14
Height = 18
Top = 31
Width = 83
Width = 115
Caption = 'Tree has ? nodes'
ParentColor = False
end
object lblTreeDepth: TLabel
Left = 11
Height = 14
Height = 18
Top = 55
Width = 123
Width = 167
Caption = 'Tree has max depth of ??'
ParentColor = False
end
object cbShowWhiteSpace: TCheckBox
Left = 11
Height = 19
Height = 23
Top = 5
Width = 110
Width = 141
Caption = 'Show whitespace'
OnClick = cbShowWhiteSpaceClick
TabOrder = 0
@ -113,10 +112,10 @@ object frmShowParseTree: TfrmShowParseTree
TabOrder = 3
object tsTokens: TTabSheet
Caption = 'Tokens'
ClientHeight = 371
ClientHeight = 367
ClientWidth = 573
object lvTokens: TListView
Height = 371
Height = 367
Width = 573
Align = alClient
Columns = <

View File

@ -42,7 +42,11 @@ uses
Windows, SysUtils, Classes, Controls, Forms,
ComCtrls, ExtCtrls, StdCtrls, ShellAPI,
{ local }
ParseTreeNode;
ParseTreeNode
{$ifdef FPC}
, LResources
{$endif}
;
type
TfrmShowParseTree = class(TForm)
@ -85,9 +89,7 @@ procedure ShowParseTree(const pcRoot: TParseTreeNode);
implementation
{$ifdef FPC}
{$R *.lfm}
{$else}
{$ifndef FPC}
{$R *.dfm}
{$endif}
@ -325,4 +327,7 @@ begin
end;
end;
initialization
{$I fShowParseTree.lrs}
end.

View File

@ -50,7 +50,7 @@ implementation
uses
SysUtils,
JclStrings, JclAnsiStrings,
JcfUtils,
SourceToken, SettingsTypes, Tokens, ParseTreeNodeType,
JcfSettings, FormatFlags, TokenUtils;
@ -77,7 +77,7 @@ begin
ctLower:
pct.SourceCode := AnsiLowerCase(pct.SourceCode);
ctMixed:
pct.SourceCode := JclStrings.StrSmartCase(AnsiLowerCase(pct.SourceCode), []);
pct.SourceCode := JcfUtils.StrSmartCase(AnsiLowerCase(pct.SourceCode), []);
ctLeaveAlone: ;
end;
end;

View File

@ -57,8 +57,8 @@ uses
{ delphi }
SysUtils,
Windows,
{ JCL }
JclAnsiStrings,
{ JCF }
JcfUtils,
{ local }
SourceToken, Tokens, ParseTreeNodeType,
JcfSettings, FormatFlags, TokenUtils;

View File

@ -77,7 +77,7 @@ uses
{ delphi }
SysUtils, Windows,
{ Jcl}
JclStrings, JclAnsiStrings, JclSysUtils;
JcfUtils;
type
TRFlagNameData = record
@ -183,24 +183,24 @@ begin
{ all comments without the required prefix are of no import to this code
if it's not one, then exit without error }
lsPrefix := JclStrings.StrLeft(psComment, 6);
lsPrefix := JcfUtils.StrLeft(psComment, 6);
if not (AnsiSameText(lsPrefix, FORMAT_COMMENT_PREFIX)) then
exit;
// should be a valid jcf flag directive after here
Result := True;
lsRest := Trim(JclStrings.StrRestOf(psComment, 7));
lsRest := Trim(JcfUtils.StrRestOf(psComment, 7));
{ rest should read <setting>=<state>
where the setting is one of the format flags, and the state is 'on' or 'off'
}
lsSetting := Trim(JclStrings.StrBefore('=', lsRest));
lsState := Trim(JclStrings.StrAfter('=', lsRest));
lsSetting := Trim(JcfUtils.StrBefore('=', lsRest));
lsState := Trim(JcfUtils.StrAfter('=', lsRest));
{ is the comment well formed? }
if (lsSetting = '') or (lsState = '') then
begin
psError := 'Comment ' + JclStrings.StrDoubleQuote(psComment) +
psError := 'Comment ' + JcfUtils.StrDoubleQuote(psComment) +
' has prefix but cannot be parsed';
exit;
end;
@ -209,10 +209,10 @@ begin
try
pbOn := LStrToBoolean(lsState);
except
On EJclConversionError do
On EJcfConversionError do
begin
psError := 'In comment ' + JclStrings.StrDoubleQuote(psComment) + ' , ' +
' state ' + JclStrings.StrDoubleQuote(lsState) + ' cannot be parsed to either on or off';
psError := 'In comment ' + JcfUtils.StrDoubleQuote(psComment) + ' , ' +
' state ' + JcfUtils.StrDoubleQuote(lsState) + ' cannot be parsed to either on or off';
exit;
end
else
@ -244,8 +244,8 @@ begin
if not lbFlagFound then
begin
// unknown setting - nothing to do except log a message
psError := 'In comment ' + JclStrings.StrDoubleQuote(psComment) + ' , ' +
' setting ' + JclStrings.StrDoubleQuote(lsSetting) + ' is not known';
psError := 'In comment ' + JcfUtils.StrDoubleQuote(psComment) + ' , ' +
' setting ' + JcfUtils.StrDoubleQuote(lsSetting) + ' is not known';
exit;
end;
end;

View File

@ -54,7 +54,7 @@ uses
{ delphi }
SysUtils,
{ jcf }
JclStrings, JclAnsiStrings,
JcfUtils,
SourceToken, Nesting, FormatFlags, JcfSettings, TokenUtils,
Tokens, ParseTreeNode, ParseTreeNodeType, SetIndent, SetAsm;
@ -644,7 +644,7 @@ begin
if (lcPrev <> nil) and (lcPrev.TokenType = ttWhiteSpace) then
begin
lcPrev.SourceCode :=
JclStrings.StrRepeat(AnsiSpace, liDesiredIndent - lcPrev.XPosition + 1);
JcfUtils.StrRepeat(AnsiSpace, liDesiredIndent - lcPrev.XPosition + 1);
end;
{
else if liDesiredIndent > 0 then

View File

@ -70,7 +70,7 @@ implementation
uses
{ delphi }
SysUtils,
JclStrings, JclAnsiStrings,
JcfUtils,
{ JCF }
SourceToken, Tokens, ParseTreeNode, ParseTreeNodeType, TokenUtils,
JcfRegistrySettings;
@ -173,7 +173,7 @@ begin
Inc(fiCommentTokens);
fiCommentChars := fiCommentChars + liLen;
fiLines := fiLines + JclStrings.StrStrCount(lcSourceToken.SourceCode, AnsiLineBreak);
fiLines := fiLines + JcfUtils.StrStrCount(lcSourceToken.SourceCode, AnsiLineBreak);
end;
ttReturn:
begin

View File

@ -48,9 +48,9 @@ implementation
uses
{ delphi }
SysUtils, Windows,
SysUtils,
{ jcl }
JclStrings, JclAnsiStrings,
JcfUtils,
{ local }
Tokens, SourceToken, SettingsTypes,
ParseTreeNodeType, JcfSettings, FormatFlags, TokenUtils;
@ -95,7 +95,7 @@ begin
ctLower:
pt.SourceCode := AnsiLowerCase(pt.SourceCode);
ctMixed:
pt.SourceCode := JclStrings.StrSmartCase(pt.SourceCode, []);
pt.SourceCode := JcfUtils.StrSmartCase(pt.SourceCode, []);
ctLeaveAlone: ;
end;
end;

View File

@ -50,7 +50,7 @@ type
implementation
uses
JclAnsiStrings,
JcfUtils,
JcfUnicode,
SourceToken, Tokens, FormatFlags, TokenUtils, ParseTreeNodeType;

View File

@ -49,7 +49,7 @@ type
implementation
uses
JclStrings, JclAnsiStrings,
JcfUtils,
SourceToken, Tokens, ParseTreeNodeType, FormatFlags;
function CommentMustStay(const pc: TSourceToken): boolean;
@ -58,7 +58,7 @@ var
begin
Result := False;
lsPrefix := JclStrings.StrLeft(pc.SourceCode, 2);
lsPrefix := JcfUtils.StrLeft(pc.SourceCode, 2);
if (lsPrefix = '{$') or (lsPrefix = '{%') then
Result := True;
@ -75,7 +75,7 @@ begin
// these are also flags
if ((pc.CommentStyle = eDoubleSlash) and
(JclStrings.StrLeft(pc.SourceCode, FORMAT_COMMENT_PREFIX_LEN) = FORMAT_COMMENT_PREFIX)) then
(JcfUtils.StrLeft(pc.SourceCode, FORMAT_COMMENT_PREFIX_LEN) = FORMAT_COMMENT_PREFIX)) then
Result := True;
end;

View File

@ -43,7 +43,11 @@ type
implementation
uses ParseTreeNode, SourceToken, Tokens, ParseTreeNodeType, FormatFlags;
uses
SourceToken,
Tokens,
ParseTreeNodeType,
FormatFlags;
constructor TRemoveReturn.Create;
begin

View File

@ -48,7 +48,7 @@ type
implementation
uses
JclAnsiStrings,
JcfUtils,
{ local }
SourceToken, Tokens, ParseTreeNodeType,
JcfUnicode,

View File

@ -51,7 +51,7 @@ implementation
uses
SysUtils,
JclStrings, JclAnsiStrings,
JcfUtils,
FormatFlags, SourceToken, Tokens, TokenUtils, JcfSettings;
@ -74,7 +74,7 @@ begin
begin
if FormatSettings.Comments.RemoveEmptyDoubleSlashComments then
begin
lsCommentText := JclStrings.StrAfter('//', lcSourceToken.SourceCode);
lsCommentText := JcfUtils.StrAfter('//', lcSourceToken.SourceCode);
lsCommentText := Trim(lsCommentText);
if lsCommentText = '' then
BlankToken(lcSourceToken);
@ -84,8 +84,8 @@ begin
begin
if FormatSettings.Comments.RemoveEmptyCurlyBraceComments then
begin
lsCommentText := JclStrings.StrAfter('{', lcSourceToken.SourceCode);
lsCommentText := JclStrings.StrBefore('}', lsCommentText);
lsCommentText := JcfUtils.StrAfter('{', lcSourceToken.SourceCode);
lsCommentText := JcfUtils.StrBefore('}', lsCommentText);
lsCommentText := Trim(lsCommentText);
if lsCommentText = '' then
BlankToken(lcSourceToken);

View File

@ -83,7 +83,7 @@ type
implementation
uses
JclAnsiStrings,
JcfUtils,
Tokens, SourceToken, TokenUtils, JCFSettings,
FormatFlags, SettingsTypes;

View File

@ -64,8 +64,8 @@ implementation
uses
{ delphi }
SysUtils,
{ JCL }
JclAnsiStrings,
{ JCF }
JcfUtils,
{ local }
SourceToken, FormatFlags, JcfSettings, SetReturns,
TokenUtils, JcfMiscFunctions, Tokens, ParseTreeNode, ParseTreeNodeType;

View File

@ -45,8 +45,8 @@ type
implementation
uses
{ jcl }
JclAnsiStrings,
{ jcf }
JcfUtils,
{ local }
Tokens, SettingsTypes,
JcfSettings;

View File

@ -51,7 +51,7 @@ implementation
uses
{ jcl }
JclStrings, JclAnsiStrings,
JcfUtils,
{ local }
JcfSettings, SourceToken, Tokens,
FormatFlags, ParseTreeNodeType;
@ -59,7 +59,7 @@ uses
constructor TMaxSpaces.Create;
begin
inherited;
fsSpaces := JclStrings.StrRepeat(AnsiSpace, FormatSettings.Spaces.MaxSpacesInCode);
fsSpaces := JcfUtils.StrRepeat(AnsiSpace, FormatSettings.Spaces.MaxSpacesInCode);
FormatFlags := FormatFlags + [eRemoveSpace];
end;

View File

@ -49,8 +49,8 @@ type
implementation
uses
{ jcl }
JclAnsiStrings,
{ jcf }
JcfUtils,
{ local }
SourceToken, Tokens, ParseTreeNodeType, JcfSettings,
FormatFlags, TokenUtils, SettingsTypes;

View File

@ -57,7 +57,7 @@ type
implementation
uses
JclAnsiStrings,
JcfUtils,
SourceToken, Tokens, ParseTreeNodeType, JcfSettings,
FormatFlags, TokenUtils, SettingsTypes;

View File

@ -48,7 +48,7 @@ type
implementation
uses
JclStrings, JclAnsiStrings,
JcfUtils,
JcfSettings, SetSpaces, SourceToken, Tokens, ParseTreeNodeType,
FormatFlags, TokenUtils;
@ -167,7 +167,7 @@ begin
{ modify the existing previous space, or make a new one? }
if (lcPrev.TokenType = ttWhiteSpace) then
begin
lcPrev.SourceCode := JclStrings.StrRepeat(AnsiSpace, liSpaces);
lcPrev.SourceCode := JcfUtils.StrRepeat(AnsiSpace, liSpaces);
end
else
begin

View File

@ -51,7 +51,7 @@ implementation
uses
SysUtils,
JclAnsiStrings,
JcfUtils,
JcfSettings, SourceToken, Tokens, FormatFlags;
constructor TSpaceToTab.Create;

View File

@ -52,13 +52,13 @@ implementation
uses
SysUtils,
JclStrings, JclAnsiStrings,
JcfUtils,
JcfSettings, SourceToken, Tokens, FormatFlags;
constructor TTabToSpace.Create;
begin
inherited;
fsSpaces := JclStrings.StrRepeat(AnsiSpace, FormatSettings.Spaces.SpacesPerTab);
fsSpaces := JcfUtils.StrRepeat(AnsiSpace, FormatSettings.Spaces.SpacesPerTab);
FormatFlags := FormatFlags + [eAddSpace, eRemoveSpace];
end;

View File

@ -49,7 +49,7 @@ type
implementation
uses
JclAnsiStrings,
JcfUtils,
JcfMiscFunctions, SourceToken, Tokens;
constructor TVisitSetXY.Create;

View File

@ -114,8 +114,7 @@ uses
{ delphi }
Controls, Forms,
{ JCL }
JclStrings,
JclAnsiStrings,
JcfUtils,
{ local }
JcfUnicode,
SourceTokenList, SourceToken,
@ -125,7 +124,7 @@ uses
function StrInsert(const psSub, psMain: string; const piPos: integer): string;
begin
Result := JclStrings.StrLeft(psMain, piPos - 1) + psSub + JclStrings.StrRestOf(psMain, piPos);
Result := JcfUtils.StrLeft(psMain, piPos - 1) + psSub + JcfUtils.StrRestOf(psMain, piPos);
end;
@ -418,9 +417,9 @@ begin
{ splice }
lsNewOutput := JclStrings.StrLeft(fsInputCode, liRealInputStart - 1);
lsNewOutput := JcfUtils.StrLeft(fsInputCode, liRealInputStart - 1);
lsNewOutput := lsNewOutput + Copy(fsOutputCode, liOutputStart, (liOutputEnd - liOutputStart));
lsNewOutput := lsNewOutput + JclStrings.StrRestOf(fsInputCode, liRealInputEnd + Length(FORMAT_START) + Length(FORMAT_END));
lsNewOutput := lsNewOutput + JcfUtils.StrRestOf(fsInputCode, liRealInputEnd + Length(FORMAT_START) + Length(FORMAT_END));
fsOutputCode := lsNewOutput;
end;

View File

@ -113,7 +113,7 @@ implementation
uses
{ delphi }Windows, SysUtils, Dialogs, Controls, Forms,
{ jcl } JclFileUtils, JclAnsiStrings,
{ jcf } JcfUtils,
{ local }FileUtils, JcfMiscFunctions, JCFLog,
JcfRegistrySettings, JcfSettings, JCfUnicodeFiles;

View File

@ -135,9 +135,8 @@ implementation
uses
{ delphi }
SysUtils, Dialogs, Windows,
{ jcl }
JclStrings,
JclAnsiStrings,
{ jcf }
JcfUtils,
{ local }
JCFSetBase,
JcfRegistrySettings;
@ -234,7 +233,7 @@ begin
// debug ShowMessage('Reading settings from file ' + lsSettingsFileName);
// now we know the file exists - try get settings from it
lsText := JclStrings.FileToString(psFileName);
lsText := JcfUtils.FileToString(psFileName);
lcFile := TSettingsInputString.Create(lsText);
try
FromStream(lcFile);

View File

@ -188,7 +188,7 @@ uses
{ delphi }
SysUtils, Dialogs,
{ jcl }
JclFileUtils, JclSysInfo, JclShell, JclStrings, JclAnsiStrings,
JcfUtils,
{ jcf }
JcfMiscFunctions;
@ -538,10 +538,10 @@ begin
if not Result then
begin
liPos := JclStrings.StrLastPos('/', psDir);
liPos := JcfUtils.StrLastPos('/', psDir);
if liPos > 0 then
begin
lsBareDir := JclStrings.StrRestOf(psDir, liPos + 1);
lsBareDir := JcfUtils.StrRestOf(psDir, liPos + 1);
Result := (fcExclusionsDirs.IndexOf(lsBareDir) >= 0);
end;
end;
@ -582,7 +582,7 @@ begin
begin
lsExt := ExtractFileExt(psIn);
liMainFileNameLength := Length(psIn) - Length(lsExt);
Result := JclStrings.StrLeft(psIn, liMainFileNameLength);
Result := JcfUtils.StrLeft(psIn, liMainFileNameLength);
if peMode = cmInPlaceWithBackup then
Result := Result + '.' + BackupExtension

View File

@ -72,8 +72,7 @@ implementation
uses
SysUtils,
JclStrings,
JclAnsiStrings;
JcfUtils;
const
REG_ONCE_OFFS = 'OnceOffs';
@ -110,8 +109,8 @@ function TSetClarify.ExtensionIsFormatted(psExt: string): boolean;
begin
psExt := Trim(psExt);
if JclStrings.StrLeft(psExt, 1) = '.' then
psExt := JclStrings.StrRestof(psExt, 2);
if JcfUtils.StrLeft(psExt, 1) = '.' then
psExt := JcfUtils.StrRestof(psExt, 2);
Result := (FileExtensions.IndexOf(psExt) >= 0);
end;

View File

@ -69,7 +69,7 @@ implementation
uses
{ delphi }SysUtils,
{ jcl }JclStrings, JclAnsiStrings;
{ jcf }JcfUtils;
const
REG_ENABLED = 'Enabled';
@ -124,8 +124,8 @@ begin
liPos := Pos(';', ps);
if liPos > 0 then
begin
psOut1 := Trim(JclStrings.StrLeft(ps, liPos - 1));
psOut2 := Trim(JclStrings.StrRestOf(ps, liPos + 1));
psOut1 := Trim(JcfUtils.StrLeft(ps, liPos - 1));
psOut2 := Trim(JcfUtils.StrRestOf(ps, liPos + 1));
end;
end;

View File

@ -157,7 +157,7 @@ uses
{ delphi }
SysUtils, Windows,
{ jcl }
JclStrings, JclAnsiStrings, JclSysUtils,
JcfUtils,
{ local}
JcfMiscFunctions;
@ -256,14 +256,14 @@ end;
procedure TSettingsStreamOutput.OpenSection(const psName: string);
begin
WriteText(JclStrings.StrRepeat(' ', fiOpenSections) + '<' + psName + '>' + AnsiLineBreak);
WriteText(JcfUtils.StrRepeat(' ', fiOpenSections) + '<' + psName + '>' + AnsiLineBreak);
Inc(fiOpenSections);
end;
procedure TSettingsStreamOutput.CloseSection(const psName: string);
begin
Dec(fiOpenSections);
WriteText(JclStrings.StrRepeat(' ', fiOpenSections) + '</' + psName + '>' + AnsiLineBreak);
WriteText(JcfUtils.StrRepeat(' ', fiOpenSections) + '</' + psName + '>' + AnsiLineBreak);
end;
@ -272,7 +272,7 @@ var
lsTemp: string;
begin
Assert(fcStream <> nil);
lsTemp := JclStrings.StrRepeat(' ', fiOpenSections + 1) + '<' + psTagName + '> ' +
lsTemp := JcfUtils.StrRepeat(' ', fiOpenSections + 1) + '<' + psTagName + '> ' +
psValue + ' </' + psTagName + '>' + AnsiLineBreak;
WriteText(lsTemp);
end;
@ -298,7 +298,7 @@ procedure TSettingsStreamOutput.Write(const psTagName: string; const pcValue: TS
var
ls: string;
begin
ls := JclStrings.StringsToStr(pcValue, ', ');
ls := JcfUtils.StringsToStr(pcValue, ', ');
Write(psTagName, ls);
end;
@ -385,8 +385,8 @@ begin
lsStart := '<' + psTag + '>';
lsEnd := '</' + psTag + '>';
liStart := JclStrings.StrFind(lsStart, fsText, 1);
liEnd := JclStrings.StrFind(lsEnd, fsText, 1);
liStart := JcfUtils.StrFind(lsStart, fsText, 1);
liEnd := JcfUtils.StrFind(lsEnd, fsText, 1);
if (liStart > 0) and (liEnd > liStart) then
begin
@ -520,7 +520,7 @@ begin
InternalGetValue(psTag, lsNewText, lbFound);
if lbFound then
begin
JclStrings.StrToStrings(lsNewText, ',', pcStrings);
JcfUtils.StrToStrings(lsNewText, ',', pcStrings);
TrimStrings(pcStrings);
end;

View File

@ -3,8 +3,6 @@ object ExceptionDialog: TExceptionDialog
Height = 180
Top = 195
Width = 420
HorzScrollBar.Page = 419
VertScrollBar.Page = 179
BorderIcons = [biSystemMenu]
Caption = 'JCF Exception'
ClientHeight = 180
@ -14,7 +12,8 @@ object ExceptionDialog: TExceptionDialog
Font.Name = 'Segoe UI'
OnCreate = FormCreate
OnResize = FormResize
LCLVersion = '0.9.25'
ParentFont = False
LCLVersion = '0.9.27'
object btnOk: TButton
Left = 155
Height = 34

View File

@ -34,7 +34,11 @@ interface
that allows the exception text to be copied out }
uses
SysUtils, Classes, Controls, Forms, StdCtrls;
SysUtils, Classes, Controls, Forms, StdCtrls
{$IFDEF FPC}
,LResources
{$ENDIF}
;
type
TExceptionDialog = class(TForm)
@ -56,11 +60,9 @@ procedure ShowErrorMessageDialog(const psMessage: string; const psCaption: strin
implementation
uses JclAnsiStrings, ParseError, JcfFontSetFunctions;
uses JcfUtils, ParseError, JcfFontSetFunctions;
{$ifdef FPC}
{$R *.lfm}
{$else}
{$ifndef FPC}
{$R *.dfm}
{$endif}
@ -165,4 +167,8 @@ begin
mExceptionMessage.Height := ClientHeight - (btnOk.Height + (PAD * 3));
end;
initialization
{$IFDEF FPC}
{$I fJcfErrorDisplay.lrs}
{$ENDIF}
end.

View File

@ -42,11 +42,12 @@ implementation
uses
{ delphi }
StdCtrls, ComCtrls, Graphics, TypInfo,
{ jcl }
JclSysUtils, JclSysInfo;
{ jcf }
JcfUtils;
procedure SetCaptionFont(const AObjectFont: TFont);
begin
{$IFNDEF FPC}
if IsWinVista then
//if IsWinVista or IsWinServer2008 then
begin
@ -65,10 +66,12 @@ begin
AObjectFont.Name := 'MS Sans Serif';
AObjectFont.Size := 8;
end;
{$ENDIF}
end;
procedure SetContentFont(const AObjectFont: TFont);
begin
{$IFNDEF FPC}
//if IsWinVista or IsWinServer2008 then
if IsWinVista then
begin
@ -87,6 +90,7 @@ begin
AObjectFont.Name := 'Courrier New';
AObjectFont.Size := 8;
end;
{$ENDIF}
end;
@ -102,7 +106,7 @@ begin
if (FontType = ftAuto) then
begin
if (AObject.ClassType = TMemo) or (AObject.ClassType = TRichEdit) then
if (AObject.ClassType = TMemo) {$IFNDEF FPC} or (AObject.ClassType = TRichEdit) {$ENDIF} then
AFontType := ftContent
else
AFontType := ftCaption;

View File

@ -84,7 +84,7 @@ uses
{ delphi }
SysUtils, Forms,
{ jcl }
JclStrings, JclAnsiStrings, JclFileUtils, JclSysUtils;
JcfUtils;
function GetApplicationFolder: string;
begin
@ -108,7 +108,7 @@ begin
// de-localise the string if need be
if (DecimalSeparator <> '.') and (Pos(DecimalSeparator, s) > 0) then
begin
JclStrings.StrReplace(s, DecimalSeparator, '.');
JcfUtils.StrReplace(s, DecimalSeparator, '.');
end;
Val(s, Result, Code);
@ -161,14 +161,14 @@ begin
if not (DirectoryExists(psPath)) and FileExists(psPath) then
begin
// must be a file - remove the last bit
liPos := JclStrings.StrLastPos(DirDelimiter, psPath);
liPos := JcfUtils.StrLastPos(DirDelimiter, psPath);
if liPos > 0 then
psPath := JclStrings.StrLeft(psPath, liPos - 1);
psPath := JcfUtils.StrLeft(psPath, liPos - 1);
end;
liPos := JclStrings.StrLastPos(DirDelimiter, psPath);
liPos := JcfUtils.StrLastPos(DirDelimiter, psPath);
if liPos > 0 then
Result := JclStrings.StrRestOf(psPath, liPos + 1);
Result := JcfUtils.StrRestOf(psPath, liPos + 1);
end;
function SetFileNameExtension(const psFileName, psExt: string): string;
@ -184,7 +184,7 @@ begin
lsOldExt := ExtractFileExt(psFileName);
liMainFileNameLength := Length(psFileName) - Length(lsOldExt);
Result := JclStrings.StrLeft(psFileName, liMainFileNameLength);
Result := JcfUtils.StrLeft(psFileName, liMainFileNameLength);
Result := Result + '.' + psExt;
end;

View File

@ -71,8 +71,9 @@ const
implementation
uses
Classes, SysUtils,
JclAnsiStrings;
Classes,
SysUtils,
JcfUtils;
const
MaxAnsiChar = 127;

View File

@ -47,7 +47,7 @@ implementation
uses
Classes, SysUtils, Dialogs,
JclAnsiStrings,
JcfUtils,
JcfUnicode;
const

View File

@ -0,0 +1,306 @@
unit JcfUtils;
{$I JcfGlobal.inc}
interface
uses
SysUtils, Classes;
const
AnsiNull = Char(#0);
AnsiSoh = Char(#1);
AnsiStx = Char(#2);
AnsiEtx = Char(#3);
AnsiEot = Char(#4);
AnsiEnq = Char(#5);
AnsiAck = Char(#6);
AnsiBell = Char(#7);
AnsiBackspace = Char(#8);
AnsiTab = Char(#9);
AnsiLineFeed = AnsiChar(#10);
AnsiVerticalTab = Char(#11);
AnsiFormFeed = Char(#12);
AnsiCarriageReturn = AnsiChar(#13);
AnsiCrLf = AnsiString(#13#10);
AnsiSo = Char(#14);
AnsiSi = Char(#15);
AnsiDle = Char(#16);
AnsiDc1 = Char(#17);
AnsiDc2 = Char(#18);
AnsiDc3 = Char(#19);
AnsiDc4 = Char(#20);
AnsiNak = Char(#21);
AnsiSyn = Char(#22);
AnsiEtb = Char(#23);
AnsiCan = Char(#24);
AnsiEm = Char(#25);
AnsiEndOfFile = Char(#26);
AnsiEscape = Char(#27);
AnsiFs = Char(#28);
AnsiGs = Char(#29);
AnsiRs = Char(#30);
AnsiUs = Char(#31);
AnsiSpace = Char(' ');
AnsiComma = Char(',');
AnsiBackslash = Char('\');
AnsiForwardSlash = Char('/');
{$IFDEF MSWINDOWS}
AnsiLineBreak = AnsiCrLf;
PathSeparator = '\';
{$ENDIF MSWINDOWS}
{$IFDEF UNIX}
AnsiLineBreak = AnsiLineFeed;
PathSeparator = '/';
{$ENDIF UNIX}
DirDelimiter = PathSeparator;
AnsiHexDigits = ['0'..'9', 'A'..'F', 'a'..'f'];
AnsiWhiteSpace = [AnsiTab, AnsiLineFeed, AnsiVerticalTab,
AnsiFormFeed, AnsiCarriageReturn, AnsiSpace];
AnsiDoubleQuote = Char('"');
AnsiSingleQuote = Char('''');
const
// CharType return values
C1_UPPER = $0001; // Uppercase
C1_LOWER = $0002; // Lowercase
C1_DIGIT = $0004; // Decimal digits
C1_SPACE = $0008; // Space characters
C1_PUNCT = $0010; // Punctuation
C1_CNTRL = $0020; // Control characters
C1_BLANK = $0040; // Blank characters
C1_XDIGIT = $0080; // Hexadecimal digits
C1_ALPHA = $0100; // Any linguistic character: alphabetic, syllabary, or ideographic
function CharIsAlpha(const C: Char): Boolean;
function CharIsAlphaNum(const C: Char): Boolean;
function CharIsControl(const C: Char): Boolean;
function CharIsDigit(const C: Char): Boolean;
function CharIsReturn(const C: Char): Boolean;
function CharIsWhiteSpace(const C: Char): Boolean;
function CharUpper(const C: Char): Char;
function StrIsAlpha(const S: string): Boolean;
function StrIsAlphaNum(const S: string): Boolean;
function StrTrimQuotes(const S: string): string;
function StrAfter(const SubStr, S: string): string;
function StrBefore(const SubStr, S: string): string;
function StrChopRight(const S: string; N: Integer): string;
function StrLastPos(const SubStr, S: string): Integer;
function StrLeft(const S: string; Count: Integer): string;
function StrRestOf(const S: string; N: Integer ): string;
function StrRight(const S: string; Count: Integer): string;
function StrDoubleQuote(const S: string): string;
function StrSmartCase(const S: string; Delimiters: TSysCharSet): string;
function StrCharCount(const S: string; C: Char): Integer;
function StrStrCount(const S, SubS: string): Integer;
function StrRepeat(const S: string; Count: Integer): string;
procedure StrReplace(var S: string; const Search, Replace: string; Flags: TReplaceFlags = []);
function StrSearch(const Substr, S: string; const Index: Integer = 1): Integer;
function BooleanToStr(B: Boolean): string;
function StrToBoolean(const S: string): Boolean;
function StrFind(const Substr, S: string; const Index: Integer = 1): Integer;
procedure StrToStrings(S, Sep: string; const List: TStrings; const AllowEmptyString: Boolean = True);
function StringsToStr(const List: TStrings; const Sep: string; const AllowEmptyString: Boolean = True): string;
procedure TrimStrings(const List: TStrings; DeleteIfEmpty: Boolean = True );
function FileToString(const FileName: string): AnsiString;
procedure StringToFile(const FileName: string; const Contents: AnsiString);
function StrFillChar(const C: Char; Count: Integer): string;
function IntToStrZeroPad(Value, Count: Integer): AnsiString;
function PathExtractFileNameNoExt(const Path: string): string;
function GetWindowsTempFolder: string;
function FileGetSize(const FileName: string): Int64;
procedure ShellExecEx(const FileName: string; const Parameters: string = '');
type
EJcfConversionError = class(Exception)
end;
implementation
function CharIsAlpha(const C: Char): Boolean;
begin
end;
function CharIsAlphaNum(const C: Char): Boolean;
begin
end;
function CharIsControl(const C: Char): Boolean;
begin
end;
function CharIsDigit(const C: Char): Boolean;
begin
end;
function CharIsReturn(const C: Char): Boolean;
begin
end;
function CharIsWhiteSpace(const C: Char): Boolean;
begin
end;
function CharUpper(const C: Char): Char;
begin
// Paul: original code used char case table
Result := UpCase(C);
end;
function StrIsAlpha(const S: string): Boolean;
begin
end;
function StrIsAlphaNum(const S: string): Boolean;
begin
end;
function StrTrimQuotes(const S: string): string;
begin
end;
function StrAfter(const SubStr, S: string): string;
begin
end;
function StrBefore(const SubStr, S: string): string;
begin
end;
function StrChopRight(const S: string; N: Integer): string;
begin
Result := Copy(S, 1, Length(S) - N);
end;
function StrLastPos(const SubStr, S: string): Integer;
begin
end;
function StrLeft(const S: string; Count: Integer): string;
begin
Result := Copy(S, 1, Count);
end;
function StrRestOf(const S: string; N: Integer ): string;
begin
Result := Copy(S, N, (Length(S) - N + 1));
end;
function StrRight(const S: string; Count: Integer): string;
begin
Result := Copy(S, Length(S) - Count + 1, Count);
end;
function StrDoubleQuote(const S: string): string;
begin
end;
function StrSmartCase(const S: string; Delimiters: TSysCharSet): string;
begin
end;
function StrCharCount(const S: string; C: Char): Integer;
begin
end;
function StrStrCount(const S, SubS: string): Integer;
begin
end;
function StrRepeat(const S: string; Count: Integer): string;
begin
end;
procedure StrReplace(var S: string; const Search, Replace: string; Flags: TReplaceFlags = []);
begin
S := StringReplace(S, Search, Replace, Flags);
end;
function StrSearch(const Substr, S: string; const Index: Integer = 1): Integer;
begin
// Paul: I expect original code was more efficient :)
Result := Pos(SubStr, Copy(S, Index, Length(S)));
end;
function BooleanToStr(B: Boolean): string;
begin
end;
function StrToBoolean(const S: string): Boolean;
begin
end;
function StrFind(const Substr, S: string; const Index: Integer = 1): Integer;
begin
// Paul: original code used comparision by char case table
Result := StrSearch(LowerCase(S), LowerCase(S), Index);
end;
procedure StrToStrings(S, Sep: string; const List: TStrings; const AllowEmptyString: Boolean = True);
begin
end;
function StringsToStr(const List: TStrings; const Sep: string; const AllowEmptyString: Boolean): string;
begin
end;
procedure TrimStrings(const List: TStrings; DeleteIfEmpty: Boolean = True );
begin
end;
function FileToString(const FileName: string): AnsiString;
begin
end;
procedure StringToFile(const FileName: string; const Contents: AnsiString);
begin
end;
function StrFillChar(const C: Char; Count: Integer): string;
begin
end;
function IntToStrZeroPad(Value, Count: Integer): AnsiString;
begin
end;
function PathRemoveExtension(const Path: string): string;
begin
end;
function PathExtractFileNameNoExt(const Path: string): string;
begin
end;
procedure StrResetLength(var S: string);
begin
end;
function PathRemoveSeparator(const Path: string): string;
begin
end;
function GetWindowsTempFolder: string;
begin
end;
function FileGetSize(const FileName: string): Int64;
begin
end;
procedure ShellExecEx(const FileName: string; const Parameters: string = '');
begin
end;
end.