28 |
|
* |
29 |
|
*) |
30 |
|
unit FBServices; |
31 |
+ |
{$IFDEF MSWINDOWS} |
32 |
+ |
{$DEFINE WINDOWS} |
33 |
+ |
{$ENDIF} |
34 |
|
|
35 |
|
{$IFDEF FPC} |
36 |
< |
{$mode objfpc}{$H+} |
36 |
> |
{$mode delphi} |
37 |
|
{$interfaces COM} |
38 |
|
{$ENDIF} |
39 |
|
|
50 |
|
private |
51 |
|
FFirebirdAPI: IFirebirdAPI; |
52 |
|
FProtocol: TProtocol; |
53 |
< |
FServerName: string; |
53 |
> |
FServerName: AnsiString; |
54 |
|
procedure CheckServerName; |
55 |
|
protected |
56 |
|
FSPB: ISPB; |
57 |
< |
procedure InternalAttach(ConnectString: string); virtual; abstract; |
57 |
> |
procedure InternalAttach(ConnectString: AnsiString); virtual; abstract; |
58 |
|
public |
59 |
< |
constructor Create(ServerName: string; Protocol: TProtocol; SPB: ISPB); |
59 |
> |
constructor Create(ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB); |
60 |
|
destructor Destroy; override; |
61 |
|
public |
62 |
|
{IServiceManager} |
63 |
|
function getSPB: ISPB; |
64 |
< |
function getServerName: string; |
64 |
> |
function getServerName: AnsiString; |
65 |
|
procedure Attach; |
66 |
|
procedure Detach(Force: boolean=false); virtual; abstract; |
67 |
|
function AllocateSRB: ISRB; |
68 |
|
function AllocateSQPB: ISQPB; |
69 |
< |
function Query(SQPB: ISQPB; Request: ISRB): IServiceQueryResults; virtual; abstract; overload; |
69 |
> |
function Query(SQPB: ISQPB; Request: ISRB): IServiceQueryResults; overload; virtual; abstract; |
70 |
|
function Query(Request: ISRB): IServiceQueryResults; overload; |
71 |
|
end; |
72 |
|
|
82 |
|
IBError(ibxeServerNameMissing, [nil]); |
83 |
|
end; |
84 |
|
|
85 |
< |
constructor TFBServiceManager.Create(ServerName: string; Protocol: TProtocol; |
85 |
> |
constructor TFBServiceManager.Create(ServerName: AnsiString; Protocol: TProtocol; |
86 |
|
SPB: ISPB); |
87 |
|
begin |
88 |
|
inherited Create; |
104 |
|
Result := FSPB; |
105 |
|
end; |
106 |
|
|
107 |
< |
function TFBServiceManager.getServerName: string; |
107 |
> |
function TFBServiceManager.getServerName: AnsiString; |
108 |
|
begin |
109 |
|
Result := FServerName; |
110 |
|
end; |
111 |
|
|
112 |
|
procedure TFBServiceManager.Attach; |
113 |
< |
var ConnectString: String; |
113 |
> |
var ConnectString: AnsiString; |
114 |
|
begin |
115 |
|
case FProtocol of |
116 |
|
TCP: ConnectString := FServerName + ':service_mgr'; {do not localize} |