Evaluation of the PropertyTree library

I am currently using the PropertyTree library and I think it's both useful and easy to use. I haven't looked too much into the implementation, but I wanted to mention that although the library enables the use of wchar_t for properties and their values, it does not do so for file names (xml_read for instance takes a "std::string" for a filename). There are, however, people amongst us that work on operating systems with Unicode-enabled file systems. This should be supported by the library. Sincerely, Christian Strömsdörfer

Stroemsdoerfer, Christian wrote:
I am currently using the PropertyTree library and I think it's both useful and easy to use. I haven't looked too much into the implementation, but I wanted to mention that although the library enables the use of wchar_t for properties and their values, it does not do so for file names (xml_read for instance takes a "std::string" for a filename). There are, however, people amongst us that work on operating systems with Unicode-enabled file systems. This should be supported by the library.
This is not so much the fault of the PropertyTree library as that of the underlying I/O system: fstreams don't support wchar_t filenames either. Sebastian Redl

Hi Christian, Property tree uses fstream class to access the file and fstream is limited to narrow char filenames. Quick workaround would be to read the data into memory using your favourite read function (that takes Unicode filenames), copy the data into a std::string, and finally create a std::stringstream, which can be used as argument for read functions. Obviously, this is quite complicated and makes a lot of unnecessary copies of the data. What is needed to solve the problem satisfactorily is std::fstream class that can use wide filenames. Unfortunately C++ std library does not provide it. This might be a material for a separate boost library. Marcin
participants (3)
-
Marcin Kalicinski
-
Sebastian Redl
-
Stroemsdoerfer, Christian