serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
706 stars 152 forks source link

Update elfio.hpp #110

Closed tgotic closed 1 year ago

tgotic commented 1 year ago

Enable loading of wide char file names.

serge1 commented 1 year ago

Could you please explain the intention of this commit and what kind of problems it addresses?

serge1 commented 1 year ago

The problem with such approach is that it breaks library's API backward compatibility

tgotic commented 1 year ago

I'm loading elf file with unicode (UTF-16) name. So I need function that accepts wstring. There are two possibilities: new load function bool load(const std::wstring& file_name) or template <typename T> bool load( const std::basic_string<T>& file_name ). Maybe first option would be better?

serge1 commented 1 year ago

Yes, the first option with explicit type would be better. But, then, stream.open() would require casting to const char* s anyhow. Such casting can be done at a caller level. I guess, UTF-8 file name conversion should be used by the caller

serge1 commented 1 year ago

I'm closing this PR. If you have more information regarding it, please feel free to reopen.