Loading Hex Values with tinyXML
Hello all.
Any one know of a way to load hex values written in a 0xff332255 or ff332255 style and load them with tinyxml. Or will I be better off loading a string and then writing a conversion function?
I'm using this for loading color values for Gui elements and it makes a lot more sense to me to write ff332255 over 4281541205.
Couldn't you save the values in RGB-format, and parse that instead?
EDIT: I mean as 0-255, in tags of <R>255</R> or so...
EDIT: I mean as 0-255, in tags of <R>255</R> or so...
Quote:Original post by NisseBosseLasse
Couldn't you save the values in RGB-format, and parse that instead?
EDIT: I mean as 0-255, in tags of <R>255</R> or so...
I very easyly could, but the way I am using the values as DWORDs in my program so I'd have to convert them once I've loaded the values, and I am getting my color values from a color picker that gives me the Hex value. I also have become very accoustumed to reading hex as colors and it will keep everything nice and condensed in my xml file.
I think I am just going to load them as strings and use a std::istringstream and std::hex. Works well enough.
EDIT: humm seemed to have missed strtoi/_strtoi64 will try this as well;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement