forked from zamronypj/fano
/
ResponseImpl.pas
51 lines (43 loc) · 1.19 KB
/
ResponseImpl.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{*!
* Fano Web Framework (https://fanoframework.github.io)
*
* @link https://github.com/fanoframework/fano
* @copyright Copyright (c) 2018 Zamrony P. Juhara
* @license https://github.com/fanoframework/fano/blob/master/LICENSE (MIT)
*}
unit ResponseImpl;
interface
{$MODE OBJFPC}
{$H+}
uses
DependencyIntf,
ResponseIntf,
HeadersIntf,
ResponseStreamIntf,
CloneableIntf,
BaseResponseImpl;
type
(*!------------------------------------------------
* base Http response class
*
* @author Zamrony P. Juhara <zamronypj@yahoo.com>
*-----------------------------------------------*)
TResponse = class(TBaseResponse, IDependency)
public
function clone() : ICloneable; override;
end;
implementation
function TResponse.clone() : ICloneable;
var clonedObj : IResponse;
begin
clonedObj := TResponse.create(
headers().clone() as IHeaders,
//TODO : do we need to create new instance?
//response stream may contain big data
//so just pass the current stream (for now)
body()
);
//TODO : copy any property
result := clonedObj;
end;
end.