my problem with irrXML

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

my problem with irrXML

Post by Halan »

hey guys,

im using irrxml only in my current project but i dont get how i can easily get a wchar_t which has the value of returnAttributeValue cause its only returning const char* :S

normally xyou can use stringw but niko hasnt implentet irrstring.h in IrrXML and i dont want to convert / rewrite everything and im not used to string.h or so. can maybe somebody give me a hint?

greets,
halan
jrm
Posts: 111
Joined: Tue Dec 13, 2005 8:57 pm

Post by jrm »

What exactly are you trying to get, the name of the node, or a value?

JRM
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

a value
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Code: Select all

core::stringw wStr = xmlReader->getAttributeValue();
Then you can get the wchar_t* data by using the c_str function of core::stringw.
Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The XML reader class IIrrXMLReader is a template. Within Irrlicht, there are two types that are available-- IXMLReader and IXMLReaderUTF8. The first of those uses wchar_t internally and always returns wchar_t strings.

If you are not using Irrlicht, but are using IrrXML directly, there are the createIrrXMLReader family of functions that return XML readers for 8, 16 and 32-bit characters.

Travis
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

Spintz wrote:

Code: Select all

core::stringw wStr = xmlReader->getAttributeValue();
Then you can get the wchar_t* data by using the c_str function of core::stringw.
yeah thats the point stringw is not implented in irrxml:S
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

then use mbstowcs and vice versa, or as Vitek said.

I personally don't like irrXML at all. I hate XML altogether in fact. But everyone else uses it, so I'm screwed.
Image
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

well spintz what do you prefer instead of xml?
Post Reply