Function toWidePath

Synopsis

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

std::wstring toWidePath(const std::string &strUtf8Path)

Description

Convert a UTF-8 path with arbitrary directory separator to a wide string path.

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

Note
On Windows, slash directory separators are converted to backslash. Although it accepts both slash and backslash as directory separator in its API, it is better to stick to its standard.
Remark
On other OSes, slashes are not converted to backslashes, since they are not interpreted as directory separators and are valid characters for directory/file names.
Parameters

strUtf8Path - Ascii path considered as being UTF-8.

Returns
std::wstring path with, on windows, standard backslash directory separator to stick to its standard.

Source

Lines 222-225 in lib/inc/drogon/utils/Utilities.h.

inline std::wstring toWidePath(const std::string &strUtf8Path)
{
    return trantor::utils::toWidePath(strUtf8Path);
}





Add Discussion as Guest

Log in