2013-10-17 22:13:54 +02:00
|
|
|
/*
|
2018-10-31 17:54:59 +01:00
|
|
|
* Copyright 2003-2018 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
|
|
|
|
|
2018-08-20 16:19:17 +02:00
|
|
|
#include "util/Compiler.h"
|
2015-02-25 16:10:24 +01:00
|
|
|
#include "Traits.hxx"
|
2018-11-19 12:49:45 +01:00
|
|
|
#include "config.h"
|
2013-10-17 22:13:54 +02:00
|
|
|
|
2017-12-12 10:22:20 +01:00
|
|
|
#if (defined(HAVE_ICU) || defined(HAVE_ICONV)) && !defined(_WIN32)
|
2014-11-29 23:35:49 +01:00
|
|
|
#define HAVE_FS_CHARSET
|
|
|
|
#endif
|
|
|
|
|
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 *
|
2017-05-08 14:44:49 +02:00
|
|
|
GetFSCharset() noexcept;
|
2013-10-17 22:13:54 +02:00
|
|
|
|
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
|
2017-05-08 14:44:49 +02:00
|
|
|
DeinitFSCharset() noexcept;
|
2014-11-29 23:35:18 +01:00
|
|
|
|
2013-10-17 22:13:54 +02:00
|
|
|
/**
|
|
|
|
* Convert the path to UTF-8.
|
2016-04-12 21:24:16 +02:00
|
|
|
*
|
|
|
|
* Throws std::runtime_error on error.
|
2013-10-17 22:13:54 +02:00
|
|
|
*/
|
2017-05-08 14:48:58 +02:00
|
|
|
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.
|
2016-04-12 21:24:16 +02:00
|
|
|
*
|
|
|
|
* Throws std::runtime_error on error.
|
2014-11-30 00:17:08 +01:00
|
|
|
*/
|
2017-05-08 14:48:58 +02:00
|
|
|
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
|