libcryfs/src/cryfs-cli/program_options/ProgramOptions.h
Sebastian Messmer 40c64a879c Hide fuse quirks inside the Fuse class.
fuse_main needs the program arguments as char ** instead of const char ** or (even better) vector<string>.
With this commit, we hide that inside the Fuse class. Everything outside handles these arguments as vector<string> and passes it as such to the Fuse class.
2016-05-09 16:07:02 -07:00

51 lines
2.1 KiB
C++

#pragma once
#ifndef MESSMER_CRYFS_PROGRAMOPTIONS_PROGRAMOPTIONS_H
#define MESSMER_CRYFS_PROGRAMOPTIONS_PROGRAMOPTIONS_H
#include <vector>
#include <string>
#include <boost/optional.hpp>
#include <cpp-utils/macros.h>
#include <boost/filesystem.hpp>
namespace cryfs {
namespace program_options {
class ProgramOptions final {
public:
ProgramOptions(const boost::filesystem::path &baseDir, const boost::filesystem::path &mountDir,
const boost::optional<boost::filesystem::path> &configFile,
bool foreground, const boost::optional<double> &unmountAfterIdleMinutes,
const boost::optional<boost::filesystem::path> &logFile,
const boost::optional<std::string> &cipher,
const boost::optional<uint32_t> &blocksizeBytes,
const std::vector<std::string> &fuseOptions);
ProgramOptions(ProgramOptions &&rhs) = default;
const boost::filesystem::path &baseDir() const;
const boost::filesystem::path &mountDir() const;
const boost::optional<boost::filesystem::path> &configFile() const;
bool foreground() const;
const boost::optional<std::string> &cipher() const;
const boost::optional<uint32_t> &blocksizeBytes() const;
const boost::optional<double> &unmountAfterIdleMinutes() const;
const boost::optional<boost::filesystem::path> &logFile() const;
const std::vector<std::string> &fuseOptions() const;
private:
boost::filesystem::path _baseDir;
boost::filesystem::path _mountDir;
boost::optional<boost::filesystem::path> _configFile;
bool _foreground;
boost::optional<std::string> _cipher;
boost::optional<uint32_t> _blocksizeBytes;
boost::optional<double> _unmountAfterIdleMinutes;
boost::optional<boost::filesystem::path> _logFile;
std::vector<std::string> _fuseOptions;
DISALLOW_COPY_AND_ASSIGN(ProgramOptions);
};
}
}
#endif