[omniORB] Portable way of casting a const char * to Octet *

Allan Wind allanwind@attbi.com
Mon Nov 18 04:26:02 2002


--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

What is a portable way of getting a 'Octet *' from a 'const char *'?
I have a auto_ptr<ostringstream> (oss) and want to return a
sequence<octet> and came up with this monster:

ucgi::sequence_of_octets_var r =3D new ucgi::sequence_of_octets(oss->str().=
size(),=20
	oss->str().size(), (CORBA::Octet *) oss->str().c_str());             =20
return r._retn();

but the c-style cast bugs me so is there a better way without making
another copy?


/Allan
--=20
Allan Wind
P.O. Box 2022
Woburn, MA 01888-0022
USA

--nFreZHaLTZJo0R7j
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE92GuwerJrYp1ydncRAuZEAJ9vVAGgX3kyml80EUE0PlUJp6RfggCgisxk
16RVoFFFZOLOeU5Ls47dBc4=
=uQG7
-----END PGP SIGNATURE-----

--nFreZHaLTZJo0R7j--