unit client_decorators; {< This unit defines common decorators for packets going to and from clients, to and from Asterisk.} { This file is part of AMIProxyPal. AMIProxyPal is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Foobar. If not, see . } {$mode objfpc}{$H+} interface uses Classes, SysUtils; type {: Abstract class definition of TProxyDecorator. } TProxyDecoratorAbs = class(TObject) public {: Used to decorate packet content. } function Decorate(APacket: string): string; virtual; abstract; {: Used to un-decorate packet content to format asterisk understands. } function UnDecorate(APacket: string): string; virtual; abstract; end; {: Defines a standard "place holder" decorate which does nothing. } TProxyStandardDecorator = class(TProxyDecoratorAbs) public function Decorate( APacket: string) : string; override; function UnDecorate(APacket: string): string; override; end; {: Defines an XML Decorator. } TProxyXMLDecorator = class(TProxyDecoratorAbs) end; implementation { TProxyStandardDecorator } function TProxyStandardDecorator.Decorate( APacket: string) : string; begin result := APacket; end; function TProxyStandardDecorator.UnDecorate( APacket: string) : string; begin result := APacket; end; end.