[omniORB] type Any

Christophe de Vienne cdevienne@alphacent.com
Fri Jul 12 15:46:00 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Vendredi 12 Juillet 2002 09:33, JHJE (Jan Holst Jensen) a écrit :
> Would you mind posting the solution (just how you encode the Variant String
> on to the stream) ? I am sure it could be of use to some poor soul (like
> myself :-) someday.

Hi all,

At the end of this mail I put the humble piece of code that workaround the 
string encoding made by visibroker 3.3 for delphi into the Any type (see 
previous mail of this thread for more precisions).
In it, the data_record type is a sequence of Any.

It has been writen by my collegue Christophe Martin.

Cheers,

Christophe 

The piece of code :

class procedure Tdata_recordHelper.Write(const _Output: CORBA.OutputStream;
const _Value: Myrdv_i.data_record);
var
  L0 : Cardinal;
  I0 : Cardinal;
 i : Integer;
 l : Integer;
 s : String;
begin
  L0 := Length(_Value);
  _Output.WriteULong(L0);
  if (L0 > 0) then
  begin
    for I0 := 0 to High(_Value) do
    begin
 If VarType (_Value[I0]) = varString Then
  Begin
   s := String (_Value[I0]);
   l := Length (s);
   _Output.WriteLong (18);
   _Output.WriteLong (0);
   _Output.WriteLong (l+1);
   For i:=1 To l Do _Output.WriteChar (s [i]);
   _Output.WriteOctet (0);
  End
   Else
      _Output.WriteAny(_Value[I0]);
    end;
  end;
end;




>
> -----Original Message-----
> From: Christophe de Vienne [mailto:cdevienne@alphacent.com]
> Sent: Thursday, July 11, 2002 17:23
> To: OmniOrb List
> Cc: JHJE (Jan Holst Jensen); Luke Deller; Duncan Grisby
> Subject: Re: [omniORB] type Any
>
>
> Hi,
>
> Thanks very much for your help on our problem.
>
> We finally solved the problem by inserting code in the visibroker auto
> generated files from idl (the modification is make each time by a simple
> patch program). If the element is a string, we do ourselves the encoding,
> using a combinaison of outputLong, outputChar and outputOctet...
> And it works fine !
>
> I think it was preferable to do that than to act on the server side since
> there is other ORB clients which connect to our server.
> Moreover we may switch to a more recent version of Delphi with, I guess, a
> more recent of visibroker which will, I hope, gives us less troubles...
>
> Thanks again,
>
> Christophe de Vienne
> _______________________________________________
> omniORB-list mailing list
> omniORB-list@realvnc.com
> http://www.realvnc.com/mailman/listinfo/omniorb-list
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9LpxsB+sU3TyOQjARArMIAJ42mY3nk5iqm+rQE7EXnuopmOhQbwCdGMkQ
fa+/NdMZMddJIBtb/4sBoyg=
=7xhw
-----END PGP SIGNATURE-----