On 1/5/2010 10:49 AM, David Webber wrote:
Am I right in thinking that in a program purely for a Windows
XML/Vista/7 platform, which uses all character strings in the native
UTF-16 format, I can interchange XMLCh and wchar_t with no worries?
For example
XMLCh string[] = L"This is a standard unicode string";
Yes, on Windows, XMLCh is a typedef for wchar_t. It's not a class on any
platform.
And then when a Xerces API function requires an argument of type const
XMLCh * , I can just pass it this string?
In other words are all the XMLString routines just there to give
platform independence (in particular on platforms for which UTF-16 is
not native)?
For many of the functions, that's the case. But there are XMLString
functions that have no analog in the ANSI C or C++ libraries.
The reason I ask is that it would be nice to be able to use the c
runtime library for string manipulation and/or MFC and STL string
classes. (I have no intention of going beyond the Windows environment.)
Then you should be fine, but you might want to be consistent and use
XMLCh and XMLString everywhere, just in case.
Dave