fs/AllocatedPath: add method FromUTF8Throw()
This commit is contained in:
@@ -43,6 +43,16 @@ AllocatedPath::FromUTF8(const char *path_utf8)
|
||||
#endif
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
AllocatedPath::FromUTF8Throw(const char *path_utf8)
|
||||
{
|
||||
#if defined(HAVE_FS_CHARSET) || defined(WIN32)
|
||||
return AllocatedPath(::PathFromUTF8(path_utf8));
|
||||
#else
|
||||
return FromFS(path_utf8);
|
||||
#endif
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
AllocatedPath::FromUTF8(const char *path_utf8, Error &error)
|
||||
{
|
||||
|
@@ -157,6 +157,13 @@ public:
|
||||
gcc_pure gcc_nonnull_all
|
||||
static AllocatedPath FromUTF8(const char *path_utf8);
|
||||
|
||||
/**
|
||||
* Convert a UTF-8 C string to an #AllocatedPath instance.
|
||||
* Throws a std::runtime_error on error.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
static AllocatedPath FromUTF8Throw(const char *path_utf8);
|
||||
|
||||
gcc_pure gcc_nonnull_all
|
||||
static AllocatedPath FromUTF8(const char *path_utf8, Error &error);
|
||||
|
||||
|
Reference in New Issue
Block a user