fs/Path: add method ToUTF8Throw()
This commit is contained in:
@@ -253,6 +253,10 @@ public:
|
||||
return ((Path)*this).ToUTF8();
|
||||
}
|
||||
|
||||
std::string ToUTF8Throw() const {
|
||||
return ((Path)*this).ToUTF8Throw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets directory name of this path.
|
||||
* Returns a "nulled" instance on error.
|
||||
|
@@ -25,12 +25,18 @@ std::string
|
||||
Path::ToUTF8() const noexcept
|
||||
{
|
||||
try {
|
||||
return ::PathToUTF8(c_str());
|
||||
return ToUTF8Throw();
|
||||
} catch (...) {
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
Path::ToUTF8Throw() const
|
||||
{
|
||||
return ::PathToUTF8(c_str());
|
||||
}
|
||||
|
||||
Path::const_pointer_type
|
||||
Path::GetSuffix() const noexcept
|
||||
{
|
||||
|
@@ -134,6 +134,11 @@ public:
|
||||
gcc_pure
|
||||
std::string ToUTF8() const noexcept;
|
||||
|
||||
/**
|
||||
* Like ToUTF8(), but throws on error.
|
||||
*/
|
||||
std::string ToUTF8Throw() const;
|
||||
|
||||
/**
|
||||
* Determine the "base" file name.
|
||||
* The return value points inside this object.
|
||||
|
Reference in New Issue
Block a user