-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::istringstream usage in StringUtilities::DecodeRml makes customizing String type impossible #472
Comments
Ah, I see. As far as I can tell, the istream is only used to convert from hex-encoded number in a string to an integer. Maybe there are other approaches to consider? |
I always use good old |
Yeah, I don't mind |
@gleblebedev i guess you have this worked out in your branch already? |
Yep:
and
|
@mikke89 if it looks ok I can make a PR later |
@gleblebedev Yup, looks like a good approach. Would be nice with some error handling back, checking for zero and ULONG_MAX seems sufficient. Might need adjustments to handle cases where |
@mikke89 is � not a valid symbol? Or what do you mean by checking for zero? |
Ha, github converted the html unicode symbol into symbol. |
I'm just looking over this, zero is returned if conversion can not be performed: https://en.cppreference.com/w/cpp/string/byte/strtoul. |
Until these changes, it was possible to use any string type in RmlUI as long as it had standard interface (e.g. EASTL).
Now, it is impossible because
std::istringstream
cannot accept anything butstd::string
.I am not saying that you should stop using
std::istringstream
, but maybe RmlUI needs a customization point to initializestd::istringstream
with arbitrary string type.The text was updated successfully, but these errors were encountered: