Audacity 3.2.0
Util.h
Go to the documentation of this file.
1#pragma once
2
3#include <locale>
4#include <codecvt>
5
6template<typename StringType>
7typename std::enable_if<std::is_same<StringType, std::string>::value, StringType>::type
8makeFilePath(const std::string& pathUTF8)
9{
10 return pathUTF8;
11}
12
13template<typename StringType>
14typename std::enable_if<!std::is_same<StringType, std::string>::value, StringType>::type
15makeFilePath(const std::string& pathUTF8)
16{
17 return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>{}.from_bytes(pathUTF8);
18}
std::enable_if< std::is_same< StringType, std::string >::value, StringType >::type makeFilePath(const std::string &pathUTF8)
Definition: Util.h:8