2013-10-17 22:13:54 +02:00
|
|
|
/*
|
2015-01-01 19:48:13 +01:00
|
|
|
* Copyright (C) 2003-2015 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
|
|
|
|
2014-11-30 00:59:43 +01:00
|
|
|
#if defined(HAVE_ICU) || defined(HAVE_GLIB)
|
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();
|
|
|
|
|
2014-11-29 22:33:30 +01:00
|
|
|
bool
|
|
|
|
SetFSCharset(const char *charset, Error &error);
|
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
|
|
|
|
PathToUTF8(PathTraitsFS::const_pointer 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
|
|
|
|
PathFromUTF8(PathTraitsUTF8::const_pointer path_utf8);
|
2013-10-17 22:13:54 +02:00
|
|
|
|
|
|
|
#endif
|