Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()

This commit is contained in:
Denis Krjuchkov
2013-01-24 02:26:38 +06:00
parent 3bd35d1883
commit 3c7cf94643
7 changed files with 60 additions and 54 deletions

View File

@@ -48,13 +48,6 @@ void path_global_init();
void path_global_finish();
/**
* Converts a file name in the filesystem charset to UTF-8. Returns
* NULL on failure.
*/
char *
fs_charset_to_utf8(const char *path_fs);
/**
* Converts a file name in UTF-8 to the filesystem charset. Returns a
* duplicate of the UTF-8 string on failure.
@@ -173,6 +166,13 @@ public:
return Path(Donate(), utf8_to_fs_charset(utf8));
}
/**
* Convert the path to UTF-8.
* Returns empty string on error or if #path_fs is null pointer.
*/
gcc_pure
static std::string ToUTF8(const_pointer path_fs);
/**
* Copy a #Path object.
*/
@@ -257,7 +257,9 @@ public:
* Returns empty string on error or if this instance is "nulled"
* (#IsNull returns true).
*/
std::string ToUTF8() const;
std::string ToUTF8() const {
return ToUTF8(value);
}
};
#endif