basic_string with unsigned short - initialization and usage

Hi
I want to know how to use basic_string with unsigned short (I have
mentioned below why i have to do this). Could any tell me some good
references in this topic. I am new to creating a new basic_string
class.

REASON TO CREATE THIS utf16string :-
I am trying to xerces parser which uses a XMLCh ( typedef unsigned
short XMLCh) as the basic character. Most of xerces functions have
XMLCh pointers as input. But since my application has to be unicode
supported and at the same time i cannot use wstring I cannot use
wstring since wchar_t is 32 bit in linux and XMLCh is 16 bit. So
conversion between wstring and XMLCh will not work. So i thought of
defining basic_string with unsigned short.

Coming back to my question, I know this group is not for solving issues
in c++ isses regarding any platform (linux). But i am just asking how
to use basic_string with unsigned short. Also please pass me some good
references on this topic. Do any one know a decent way of initializing
the utf16string rather than using reinterpret_cast. ?

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!