IdCoderXXE.pas 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.5 1/21/2004 1:44:18 PM JPMugaas
  18. InitComponent
  19. Rev 1.4 10/16/2003 11:11:34 PM DSiders
  20. Added localization comments.
  21. Rev 1.3 2003.06.13 6:57:12 PM czhower
  22. Speed improvement
  23. Rev 1.1 6/13/2003 08:14:38 AM JPMugaas
  24. Removed some extra line feeds causing formatting problems.
  25. Rev 1.0 11/14/2002 02:15:22 PM JPMugaas
  26. }
  27. unit IdCoderXXE;
  28. interface
  29. {$i IdCompilerDefines.inc}
  30. uses
  31. {$IFDEF WORKAROUND_INLINE_CONSTRUCTORS}
  32. Classes,
  33. {$ENDIF}
  34. IdCoder00E, IdCoder3to4;
  35. type
  36. TIdDecoderXXE = class(TIdDecoder00E)
  37. protected
  38. procedure InitComponent; override;
  39. {$IFDEF WORKAROUND_INLINE_CONSTRUCTORS}
  40. public
  41. constructor Create(AOwner: TComponent); reintroduce; overload;
  42. {$ENDIF}
  43. end;
  44. TIdEncoderXXE = class(TIdEncoder00E)
  45. protected
  46. procedure InitComponent; override;
  47. {$IFDEF WORKAROUND_INLINE_CONSTRUCTORS}
  48. public
  49. constructor Create(AOwner: TComponent); reintroduce; overload;
  50. {$ENDIF}
  51. end;
  52. const
  53. GXXECodeTable: string = '+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; {do not localize}
  54. var
  55. GXXEDecodeTable: TIdDecodeTable;
  56. implementation
  57. uses
  58. IdGlobal;
  59. { TIdEncoderXXE }
  60. {$IFDEF WORKAROUND_INLINE_CONSTRUCTORS}
  61. constructor TIdEncoderXXE.Create(AOwner: TComponent);
  62. begin
  63. inherited Create(AOwner);
  64. end;
  65. {$ENDIF}
  66. procedure TIdEncoderXXE.InitComponent;
  67. begin
  68. inherited InitComponent;
  69. FCodingTable := ToBytes(GXXECodeTable);
  70. FFillChar := GXXECodeTable[1];
  71. end;
  72. { TIdDecoderXXE }
  73. {$IFDEF WORKAROUND_INLINE_CONSTRUCTORS}
  74. constructor TIdDecoderXXE.Create(AOwner: TComponent);
  75. begin
  76. inherited Create(AOwner);
  77. end;
  78. {$ENDIF}
  79. procedure TIdDecoderXXE.InitComponent;
  80. begin
  81. inherited InitComponent;
  82. FDecodeTable := GXXEDecodeTable;
  83. FFillChar := GXXECodeTable[1];
  84. end;
  85. initialization
  86. TIdDecoder00E.ConstructDecodeTable(GXXECodeTable, GXXEDecodeTable);
  87. end.