simple-mtpfs/src/simple-mtpfs-util.h

58 lines
1.7 KiB
C
Raw Normal View History

2013-09-17 19:43:36 +00:00
/* ***** BEGIN LICENSE BLOCK *****
2014-07-09 10:34:00 +00:00
* Copyright (C) 2012-2014, Peter Hatina <phatina@gmail.com>
2013-09-17 19:43:36 +00:00
*
* 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, see <http://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK ***** */
#ifndef SIMPLE_MTPFS_UTIL
#define SIMPLE_MTPFS_UTIL
#include <config.h>
#include <string>
#ifdef HAVE_LIBUSB1
# include <libmtp.h>
#endif // HAVE_LIBUSB1
class StreamHelper
{
public:
StreamHelper() = delete;
static void on();
static void off();
private:
static bool s_enabled;
static int s_stdout;
static int s_stderr;
};
2013-09-17 19:43:36 +00:00
std::string smtpfs_dirname(const std::string &path);
std::string smtpfs_basename(const std::string &path);
2013-09-24 13:57:41 +00:00
std::string smtpfs_realpath(const std::string &path);
2013-11-25 21:26:29 +00:00
std::string smtpfs_get_tmpdir();
2013-09-17 19:43:36 +00:00
2013-11-25 21:26:29 +00:00
bool smtpfs_create_dir(const std::string &dirname);
bool smtpfs_remove_dir(const std::string &dirname);
2013-09-24 11:49:42 +00:00
bool smtpfs_check_dir(const std::string &path);
2013-09-17 19:43:36 +00:00
#ifdef HAVE_LIBUSB1
LIBMTP_raw_device_t *smtpfs_raw_device_new(const std::string &path);
void smtpfs_raw_device_free(LIBMTP_raw_device_t *device);
bool smtpfs_reset_device(LIBMTP_raw_device_t *device);
2013-09-17 19:43:36 +00:00
#endif // HAVE_LIBUSB1
#endif // SIMPLE_MTPFS_UTIL