[xsd-users] Minor issue: debug printing of byte and unsignedByte

Boris Kolpackov boris at codesynthesis.com
Thu Mar 15 15:35:44 EDT 2007


Hi Ray,

Ray Lischner <rlischner at proteus-technologies.com> writes:

> Overloading operator<<(ostream&, x) is a nice feature for quick
> debugging and dumping of data. The only problem arises with elements
> of type byte or unsignedByte. Naturally, Code Synthesis maps these
> to signed char and unsigned char, but the standard ostream class
> (incorrectly, in my opinion) prints these types as though they
> were characters, not integers. It would be better for Code
> Synthesis to insert a static_cast to int or unsigned int prior
> to streaming byte and unsignedByte values to basic_ostream.

Yes, this is definitely a good idea. Unfortunately, the implementation
is quite hairy since these two types are handled by predefined
operators. As a result, we will need to add those casts in the
generated code. I've added this to my TODO list.


thanks,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070315/68c78efc/attachment.pgp


More information about the xsd-users mailing list