Add support for other character types in filenames (fixes #6)#7
Add support for other character types in filenames (fixes #6)#7MHebes wants to merge 2 commits intosreiter:masterfrom
Conversation
|
Hi @sreiter, incorporated your requested changes from #6 (comment) |
sreiter
left a comment
There was a problem hiding this comment.
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.
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.