-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add support for other character types in filenames (fixes #6) #7
base: master
Are you sure you want to change the base?
Conversation
Hi @sreiter, incorporated your requested changes from #6 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for adjusting the template parameter name!
I just saw that you removed a method from the public interface. I think that's a bit unfortunate, since some users may already rely on that method. It would be great if you would consider my comment and reintroduce it - ideally togehter with an additional wstring
overload.
Thank's a lot!
bool read_file (const std::string& filename) | ||
{ | ||
return read_file (filename.c_str()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't see this last time. But it seems that you removed this method? I think it is in the public interface, so some users may rely on it. Unless there's a good reason to remove it, I would thus rather keep it. And if we have an std::string
overload, I think it would even make sense to add a second overload with const std::wstring&
, as you did in the constructor...
Hi @sreiter, sorry for the delay in getting this PR updated. Since it was originally made, I realized that these two macros are preventing this from working perfectly: #define STL_READER_THROW(msg) {std::stringstream ss; ss << msg; throw(std::runtime_error(ss.str()));}
#define STL_READER_COND_THROW(cond, msg) if(cond){std::stringstream ss; ss << msg; throw(std::runtime_error(ss.str()));} These are problematic with STL_READER_THROW("ERROR while reading from " << /* const wchar_t* */ filename <<
": vertex not specified correctly in line " << lineCount); where if In C++20, they actually deleted Options:
Please let me know how you'd like to proceed! |
Hi @MHebes, great to hear from you. Maybe a small overloaded function which returns the utf8 string for |
Allows unicode filenames on windows, which uses UTF-16.