Can I get filesystem::basic_path<> template to use backslashes ?
Hello Is there a way for the basic_path observer functions (string(), root_path(), relative_path(), filename()) to use backslashes instead of forward slashes on Windows ? I know Windows also accepts forward slashes, but they are not suitable for display to the user, in a dialog box. Thank you, Timothy Madden
On 29.07.2010 15:36, Timothy Madden wrote:
Is there a way for the basic_path observer functions (string(), root_path(), relative_path(), filename()) to use backslashes instead of forward slashes on Windows ?
Have you tried external_string() instead of string()? I currently can't test it, but if i remember correctly, that should give you a string formatted according to your OS path rules. Norbert
Norbert Wenzel wrote:
On 29.07.2010 15:36, Timothy Madden wrote:
Is there a way for the basic_path observer functions (string(), root_path(), relative_path(), filename()) to use backslashes instead of forward slashes on Windows ?
Have you tried external_string() instead of string()? I currently can't test it, but if i remember correctly, that should give you a string formatted according to your OS path rules.
It works and the backslashes are displayed now, thank you. The documentation makes these functions look like they apply only an encoding conversion. Could this detail with backslashes for Windows be included in their description, too ? Thank you, Timothy Madden
On 29 July 2010 06:36, Timothy Madden
Is there a way for the basic_path observer functions (string(), root_path(), relative_path(), filename()) to use backslashes instead of forward slashes on Windows ?
Use the external_file_string() and external_directory_string() observers http://www.boost.org/libs/filesystem/doc/reference.html#basic_path-observers on the paths you get back to turn them into external_string_types. ~ Scott
participants (3)
-
Norbert Wenzel
-
Scott McMurray
-
Timothy Madden