Function fromWidePath

Synopsis

#include <lib/inc/drogon/utils/Utilities.h>

std::string fromWidePath(const std::wstring &strPath)

Description

Convert a wide string path with arbitrary directory separators to a UTF-8 portable path for use with trantor.

This is a helper, mainly for Windows and multi-platform projects.

Note
On Windows, backslash directory separators are converted to slash to keep portable paths.
Remark
On other OSes, backslashes are not converted to slash, since they are valid characters for directory/file names.
Parameters

strPath - Wide string path.

Returns
std::string UTF-8 path, with slash directory separator.

Source

Lines 198-201 in lib/inc/drogon/utils/Utilities.h.

inline std::string fromWidePath(const std::wstring &strPath)
{
    return trantor::utils::fromWidePath(strPath);
}





Add Discussion as Guest

Log in