2013-10-17 22:13:54 +02:00
|
|
|
/*
|
2016-02-26 17:54:05 +01:00
|
|
|
* Copyright 2003-2016 The Music Player Daemon Project
|
2013-10-17 22:13:54 +02:00
|
|
|
* http://www.musicpd.org
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MPD_FS_CHARSET_HXX
|
|
|
|
#define MPD_FS_CHARSET_HXX
|
|
|
|
|
|
|
|
#include "check.h"
|
|
|
|
#include "Compiler.h"
|
2015-02-25 16:10:24 +01:00
|
|
|
#include "Traits.hxx"
|
2013-10-17 22:13:54 +02:00
|
|
|
|
2015-06-26 16:51:18 +02:00
|
|
|
#if (defined(HAVE_ICU) || defined(HAVE_ICONV)) && !defined(WIN32)
|
2014-11-29 23:35:49 +01:00
|
|
|
#define HAVE_FS_CHARSET
|
|
|
|
#endif
|
|
|
|
|
2014-11-29 22:33:30 +01:00
|
|
|
class Error;
|
|
|
|
|
2013-10-17 22:13:54 +02:00
|
|
|
/**
|
|
|
|
* Gets file system character set name.
|
|
|
|
*/
|
|
|
|
gcc_const
|
2013-10-17 22:47:09 +02:00
|
|
|
const char *
|
2013-10-17 22:13:54 +02:00
|
|
|
GetFSCharset();
|
|
|
|
|
2016-04-12 22:18:36 +02:00
|
|
|
/**
|
|
|
|
* Throws std::runtime_error on error.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
SetFSCharset(const char *charset);
|
2013-10-17 22:13:54 +02:00
|
|
|
|
2014-11-29 23:35:18 +01:00
|
|
|
void
|
|
|
|
DeinitFSCharset();
|
|
|
|
|
2013-10-17 22:13:54 +02:00
|
|
|
/**
|
|
|
|
* Convert the path to UTF-8.
|
2013-10-17 22:39:06 +02:00
|
|
|
* Returns empty string on error.
|
2013-10-17 22:13:54 +02:00
|
|
|
*/
|
2013-10-17 22:39:06 +02:00
|
|
|
gcc_pure gcc_nonnull_all
|
2015-02-25 16:10:24 +01:00
|
|
|
PathTraitsUTF8::string
|
2016-04-12 22:49:03 +02:00
|
|
|
PathToUTF8(PathTraitsFS::const_pointer_type path_fs);
|
2013-10-17 22:13:54 +02:00
|
|
|
|
2014-11-30 00:17:08 +01:00
|
|
|
/**
|
|
|
|
* Convert the path from UTF-8.
|
|
|
|
* Returns empty string on error.
|
|
|
|
*/
|
|
|
|
gcc_pure gcc_nonnull_all
|
2015-02-25 16:10:24 +01:00
|
|
|
PathTraitsFS::string
|
2016-04-12 22:49:03 +02:00
|
|
|
PathFromUTF8(PathTraitsUTF8::const_pointer_type path_utf8);
|
2013-10-17 22:13:54 +02:00
|
|
|
|
|
|
|
#endif
|