Fix for sample: WST now defaults to UnicodeStrings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5953 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa 2017-06-22 15:27:00 +00:00
parent be12b3e03e
commit 850d5848a9
4 changed files with 49 additions and 48 deletions

View File

@ -2,15 +2,13 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf".
Date : "22/07/2011 11:31:59".
Date : "22/06/2017 15:02:26".
}
unit user_service_intf;
{$IFDEF FPC}
{$mode objfpc} {$H+}
{$ENDIF}
{$IFNDEF FPC}
{$DEFINE WST_RECORD_RTTI}
{$ENDIF}
{$DEFINE WST_RECORD_RTTI}
interface
uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;
@ -33,30 +31,30 @@ type
TUser = class(TBaseComplexRemotable)
private
FCategory : TUserCategory;
FUserName : string;
FeMail : string;
FPreferences : string;
FUserName : UnicodeString;
FeMail : UnicodeString;
FPreferences : UnicodeString;
FNote : TNote;
public
constructor Create();override;
procedure FreeObjectProperties();override;
published
property Category : TUserCategory read FCategory write FCategory;
property UserName : string read FUserName write FUserName;
property eMail : string read FeMail write FeMail;
property Preferences : string read FPreferences write FPreferences;
property UserName : UnicodeString read FUserName write FUserName;
property eMail : UnicodeString read FeMail write FeMail;
property Preferences : UnicodeString read FPreferences write FPreferences;
property Note : TNote read FNote write FNote;
end;
TNote = class(TBaseComplexRemotable)
private
FHeader : string;
FAuthor : string;
FDate : string;
FHeader : UnicodeString;
FAuthor : UnicodeString;
FDate : UnicodeString;
published
property Header : string read FHeader write FHeader;
property Author : string read FAuthor write FAuthor;
property Date : string read FDate write FDate;
property Header : UnicodeString read FHeader write FHeader;
property Author : UnicodeString read FAuthor write FAuthor;
property Date : UnicodeString read FDate write FDate;
end;
TUserArray = class(TBaseObjectArrayRemotable)
@ -68,7 +66,7 @@ type
end;
UserService = interface(IInvokable)
['{1A6AE445-B888-41D1-BDC2-C3BE9C8F60D3}']
['{D039952C-BE65-4C35-85FD-092038A8B25D}']
function GetList():TUserArray;
procedure Add(
const AUser : TUser
@ -77,10 +75,10 @@ type
const AUser : TUser
);
function Find(
const AName : string
const AName : UnicodeString
):TUser;
function Delete(
const AName : string
const AName : UnicodeString
):boolean;
end;

View File

@ -2,7 +2,7 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf_binder".
Date : "22/07/2011 11:31:16".
Date : "22/06/2017 15:01:59".
}
unit user_service_intf_binder;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
@ -52,7 +52,7 @@ var
returnVal : TUserArray;
begin
callCtx := AContext;
Fillchar(returnVal,SizeOf(TUserArray),#0);
returnVal := nil;
tmpObj := Self.GetFactory().CreateInstance() as UserService;
@ -63,8 +63,8 @@ begin
objCntrl.Activate();
try
returnVal := tmpObj.GetList();
if Assigned(TObject(returnVal)) then
callCtx.AddObjectToFree(TObject(returnVal));
if (returnVal <> nil) then
callCtx.AddObjectToFree(returnVal);
procName := AFormatter.GetCallProcedureName();
trgName := AFormatter.GetCallTarget();
@ -93,11 +93,11 @@ var
AUser : TUser;
begin
callCtx := AContext;
Fillchar(AUser,SizeOf(TUser),#0);
AUser := nil;
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
if Assigned(Pointer(AUser)) then
callCtx.AddObjectToFree(TObject(AUser));
if (AUser <> nil) then
callCtx.AddObjectToFree(AUser);
tmpObj := Self.GetFactory().CreateInstance() as UserService;
if Supports(tmpObj,ICallControl,cllCntrl) then
@ -134,11 +134,11 @@ var
AUser : TUser;
begin
callCtx := AContext;
Fillchar(AUser,SizeOf(TUser),#0);
AUser := nil;
locStrPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),locStrPrmName,AUser);
if Assigned(Pointer(AUser)) then
callCtx.AddObjectToFree(TObject(AUser));
if (AUser <> nil) then
callCtx.AddObjectToFree(AUser);
tmpObj := Self.GetFactory().CreateInstance() as UserService;
if Supports(tmpObj,ICallControl,cllCntrl) then
@ -172,13 +172,13 @@ var
callCtx : ICallContext;
locStrPrmName : string;
procName,trgName : string;
AName : string;
AName : UnicodeString;
returnVal : TUser;
begin
callCtx := AContext;
Fillchar(returnVal,SizeOf(TUser),#0);
returnVal := nil;
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(string),locStrPrmName,AName);
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(UnicodeString),locStrPrmName,AName);
tmpObj := Self.GetFactory().CreateInstance() as UserService;
if Supports(tmpObj,ICallControl,cllCntrl) then
@ -188,8 +188,8 @@ begin
objCntrl.Activate();
try
returnVal := tmpObj.Find(AName);
if Assigned(TObject(returnVal)) then
callCtx.AddObjectToFree(TObject(returnVal));
if (returnVal <> nil) then
callCtx.AddObjectToFree(returnVal);
procName := AFormatter.GetCallProcedureName();
trgName := AFormatter.GetCallTarget();
@ -215,12 +215,12 @@ var
callCtx : ICallContext;
locStrPrmName : string;
procName,trgName : string;
AName : string;
AName : UnicodeString;
returnVal : boolean;
begin
callCtx := AContext;
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(string),locStrPrmName,AName);
locStrPrmName := 'AName'; AFormatter.Get(TypeInfo(UnicodeString),locStrPrmName,AName);
tmpObj := Self.GetFactory().CreateInstance() as UserService;
if Supports(tmpObj,ICallControl,cllCntrl) then

View File

@ -5,7 +5,10 @@ This unit has been produced by ws_helper.
Date : "30/04/2007 00:07".
}
Unit user_service_intf_imp;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$modeswitch UNICODESTRINGS}
{$ENDIF}
Interface
Uses SysUtils, Classes,

View File

@ -2,7 +2,7 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf_proxy".
Date : "22/07/2011 11:31:59".
Date : "22/06/2017 15:02:26".
}
Unit user_service_intf_proxy;
@ -14,7 +14,7 @@ Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, user_service_i
Type
TUserService_Proxy=class(TBaseProxy,UserService)
TUserService_Proxy=class(TBaseProxy,user_service_intf.UserService)
Protected
class function GetServiceType() : PTypeInfo;override;
function GetList():TUserArray;
@ -25,10 +25,10 @@ Type
const AUser : TUser
);
function Find(
const AName : string
const AName : UnicodeString
):TUser;
function Delete(
const AName : string
const AName : UnicodeString
):boolean;
End;
@ -52,7 +52,7 @@ End;
class function TUserService_Proxy.GetServiceType() : PTypeInfo;
begin
result := TypeInfo(UserService);
result := TypeInfo(user_service_intf.UserService);
end;
function TUserService_Proxy.GetList():TUserArray;
@ -70,7 +70,7 @@ Begin
MakeCall();
locSerializer.BeginCallRead(locCallContext);
TObject(Result) := Nil;
Result := Nil;
locStrPrmName := 'result';
locSerializer.Get(TypeInfo(TUserArray), locStrPrmName, Result);
@ -128,7 +128,7 @@ Begin
End;
function TUserService_Proxy.Find(
const AName : string
const AName : UnicodeString
):TUser;
Var
locSerializer : IFormatterClient;
@ -139,13 +139,13 @@ Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Find', GetTarget(),locCallContext);
locSerializer.Put('AName', TypeInfo(string), AName);
locSerializer.Put('AName', TypeInfo(UnicodeString), AName);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead(locCallContext);
TObject(Result) := Nil;
Result := Nil;
locStrPrmName := 'result';
locSerializer.Get(TypeInfo(TUser), locStrPrmName, Result);
@ -155,7 +155,7 @@ Begin
End;
function TUserService_Proxy.Delete(
const AName : string
const AName : UnicodeString
):boolean;
Var
locSerializer : IFormatterClient;
@ -166,7 +166,7 @@ Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Delete', GetTarget(),locCallContext);
locSerializer.Put('AName', TypeInfo(string), AName);
locSerializer.Put('AName', TypeInfo(UnicodeString), AName);
locSerializer.EndCall();
MakeCall();