PackageFTPParsers.pas 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. { Rev 1.4 04/09/2004 12:45:16 ANeillans
  18. { Moved the databasename and output paths into a globally accessible variable
  19. { -- makes it a lot easier to override if you need to (as I did for my local
  20. { file structure).
  21. }
  22. {
  23. { Rev 1.3 2004.06.13 8:42:42 PM czhower
  24. { Added name.
  25. }
  26. {
  27. { Rev 1.2 2004.06.13 8:06:14 PM czhower
  28. { Update for D8
  29. }
  30. {
  31. { Rev 1.1 6/8/2004 3:52:52 PM JPMugaas
  32. { FTP List generation should work.
  33. }
  34. {
  35. { Rev 1.0 6/8/2004 2:15:50 PM JPMugaas
  36. { FTP Listing unit generation.
  37. }
  38. unit PackageFTPParsers;
  39. interface
  40. uses
  41. Package;
  42. type
  43. TFTPParsers = class(TPackage)
  44. public
  45. constructor Create; override;
  46. procedure Generate(ACompiler: TCompiler); override;
  47. end;
  48. implementation
  49. uses
  50. SysUtils, DModule;
  51. { TFTPParsers }
  52. constructor TFTPParsers.Create;
  53. begin
  54. inherited;
  55. FName := 'IdAllFTPListParsers';
  56. FExt := '.pas';
  57. end;
  58. procedure TFTPParsers.Generate(ACompiler: TCompiler);
  59. var
  60. i: Integer;
  61. begin
  62. inherited;
  63. //We don't call many of the inherited Protected methods because
  64. //those are for Packages while I'm making a unit.
  65. Code('unit IdAllFTPListParsers;');
  66. Code('');
  67. Code('interface');
  68. Code('');
  69. Code('{');
  70. Code('Note that is unit is simply for listing ALL FTP List parsers in Indy.');
  71. Code('The user could then add this unit to a uses clause in their program and');
  72. Code('have all FTP list parsers linked into their program.');
  73. Code('');
  74. Code('ABSOLELY NO CODE is permitted in this unit.');
  75. Code('');
  76. Code('}');
  77. Code('// RLebeau 4/17/10: this forces C++Builder to link to this unit so');
  78. Code('// the units can register themselves correctly at program startup...');
  79. Code('');
  80. Code('(*$HPPEMIT ''#pragma link "IdAllFTPListParsers"''*)');
  81. //Now add our units
  82. Code('');
  83. Code('implementation');
  84. Code('');
  85. Code('uses');
  86. for i := 0 to FUnits.Count - 1 do begin
  87. Code(' ' + ChangeFileExt(FUnits[i], '') + iif(i < FUnits.Count - 1, ',', ';'));
  88. end;
  89. //
  90. Code('');
  91. Code('{dee-duh-de-duh, that''s all folks.}');
  92. WriteFile(DM.OutputPath + '\Lib\Protocols\');
  93. end;
  94. end.