On Sun, 15 Aug 2021 13:07:52 +0530 Jason Liam wrote:
JL> Hi, i have a file dialog and when the user selects a particular file i need
JL> to know the directory and the fullpath of the file.
Generally speaking, you might want to have a good look at wxFileName class
(or, if you're already using compiler implementing std::filesystem, at it
instead).
JL> Is there a platform independent way to add the appropriate slashes at
JL> the end of the directory path.
Just append wxFileName::GetPathSeparator() to the end of the string.
JL> Also, should I use toStdString() or ToUtf8() to convert wxString to
JL> std::string for this(above) purpose.
This depends on what your other function expects. You need to use UTF-8 if
you want to represent all the paths, including those using non-ASCII
characters, but if your function takes std::string it might not support
them in the first place.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/