RxFPC:start utils for make docs

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7189 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-11-20 12:52:37 +00:00
parent 86122e6bdb
commit 90b3824401
2 changed files with 183 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="RxFPCHelp"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<Units>
<Unit>
<Filename Value="rxfpc_gen_help.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="rxfpc_gen_help"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,127 @@
program rxfpc_gen_help;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
Classes, SysUtils, CustApp,
dom, XMLRead;
type
{ TLazPkgData }
TLazPkgData = class
private
procedure DoLoadData;
public
constructor Create(AFileName:string);
end;
{ TRxHelpApplication }
TRxHelpApplication = class(TCustomApplication)
private
procedure MakeHelp(APkgName:string);
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TLazPkgData }
procedure TLazPkgData.DoLoadData;
begin
end;
constructor TLazPkgData.Create(AFileName: string);
begin
end;
{ TRxHelpApplication }
procedure TRxHelpApplication.MakeHelp(APkgName: string);
var
P: TLazPkgData;
begin
if FileExists(APkgName) then
begin
P:=TLazPkgData.Create(APkgName);
try
finally
P.Free;
end;
end;
end;
procedure TRxHelpApplication.DoRun;
var
ErrorMsg: String;
begin
// quick check parameters
ErrorMsg:=CheckOptions('h', 'help');
if ErrorMsg<>'' then begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
MakeHelp('dcl_rx_ctrl');
MakeHelp('rxdbgrid_export_spreadsheet');
MakeHelp('rx');
MakeHelp('rx_sort_fbdataset');
MakeHelp('rx_sort_sqldb');
MakeHelp('rxtools.lpk');
MakeHelp('dcl_rxtools');
MakeHelp('rxdbgrid_print');
MakeHelp('rxnew');
MakeHelp('rx_sort_ibx');
MakeHelp('rx_sort_zeos');
// stop program loop
Terminate;
end;
constructor TRxHelpApplication.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
StopOnException:=True;
end;
destructor TRxHelpApplication.Destroy;
begin
inherited Destroy;
end;
procedure TRxHelpApplication.WriteHelp;
begin
{ add your help code here }
writeln('Usage: ', ExeName, ' -h');
end;
var
Application: TRxHelpApplication;
begin
Application:=TRxHelpApplication.Create(nil);
Application.Title:='RxFPCHelp';
Application.Run;
Application.Free;
end.