From 3c7cf94643bc45237d1e61c4e6015d498e4400b0 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Thu, 24 Jan 2013 02:26:38 +0600 Subject: Path: convert fs_charset_to_utf8() to static method Path::ToUTF8() --- src/fs/Path.hxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/fs/Path.hxx') diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index 0b51983f..87c3551e 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -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 -- cgit v1.2.3