2015-10-15 13:06:51 +02:00
|
|
|
#pragma once
|
2019-01-19 22:02:41 +01:00
|
|
|
#ifndef MESSMER_CRYFSCLI_PROGRAMOPTIONS_PROGRAMOPTIONS_H
|
|
|
|
#define MESSMER_CRYFSCLI_PROGRAMOPTIONS_PROGRAMOPTIONS_H
|
2015-09-29 14:29:10 +02:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2015-10-17 18:31:17 +02:00
|
|
|
#include <boost/optional.hpp>
|
2016-02-11 16:39:42 +01:00
|
|
|
#include <cpp-utils/macros.h>
|
2015-11-17 10:49:35 +01:00
|
|
|
#include <boost/filesystem.hpp>
|
2015-09-29 14:29:10 +02:00
|
|
|
|
2019-01-19 22:02:41 +01:00
|
|
|
namespace cryfs_cli {
|
2015-09-29 14:29:10 +02:00
|
|
|
namespace program_options {
|
2015-10-16 04:06:00 +02:00
|
|
|
class ProgramOptions final {
|
2015-09-29 14:29:10 +02:00
|
|
|
public:
|
2017-10-01 10:04:29 +02:00
|
|
|
ProgramOptions(boost::filesystem::path baseDir, boost::filesystem::path mountDir,
|
|
|
|
boost::optional<boost::filesystem::path> configFile,
|
2020-08-01 03:08:19 +02:00
|
|
|
bool foreground, bool allowFilesystemUpgrade, bool allowReplacedFilesystem,
|
|
|
|
bool createMissingBasedir, bool createMissingMountpoint,
|
|
|
|
boost::optional<double> unmountAfterIdleMinutes,
|
2017-10-01 10:04:29 +02:00
|
|
|
boost::optional<boost::filesystem::path> logFile,
|
|
|
|
boost::optional<std::string> cipher,
|
|
|
|
boost::optional<uint32_t> blocksizeBytes,
|
2018-04-29 22:41:21 +02:00
|
|
|
bool allowIntegrityViolations,
|
2017-10-01 10:04:29 +02:00
|
|
|
boost::optional<bool> missingBlockIsIntegrityViolation,
|
|
|
|
std::vector<std::string> fuseOptions);
|
2016-05-10 01:07:02 +02:00
|
|
|
ProgramOptions(ProgramOptions &&rhs) = default;
|
2015-09-29 14:29:10 +02:00
|
|
|
|
2015-11-17 10:49:35 +01:00
|
|
|
const boost::filesystem::path &baseDir() const;
|
2016-05-10 01:07:02 +02:00
|
|
|
const boost::filesystem::path &mountDir() const;
|
2015-11-17 10:49:35 +01:00
|
|
|
const boost::optional<boost::filesystem::path> &configFile() const;
|
2015-10-15 03:38:44 +02:00
|
|
|
bool foreground() const;
|
2018-02-01 11:04:59 +01:00
|
|
|
bool allowFilesystemUpgrade() const;
|
2018-02-03 17:33:59 +01:00
|
|
|
bool allowReplacedFilesystem() const;
|
2020-08-01 03:08:19 +02:00
|
|
|
bool createMissingBasedir() const;
|
|
|
|
bool createMissingMountpoint() const;
|
|
|
|
const boost::optional<double> &unmountAfterIdleMinutes() const;
|
|
|
|
const boost::optional<boost::filesystem::path> &logFile() const;
|
2015-10-30 19:53:15 +01:00
|
|
|
const boost::optional<std::string> &cipher() const;
|
2016-03-04 23:12:41 +01:00
|
|
|
const boost::optional<uint32_t> &blocksizeBytes() const;
|
2018-04-29 22:41:21 +02:00
|
|
|
bool allowIntegrityViolations() const;
|
2016-06-27 07:07:58 +02:00
|
|
|
const boost::optional<bool> &missingBlockIsIntegrityViolation() const;
|
2016-05-10 01:07:02 +02:00
|
|
|
const std::vector<std::string> &fuseOptions() const;
|
2020-08-01 03:08:19 +02:00
|
|
|
bool mountDirIsDriveLetter() const;
|
2015-09-29 14:29:10 +02:00
|
|
|
|
|
|
|
private:
|
2019-01-14 01:29:28 +01:00
|
|
|
boost::filesystem::path _baseDir; // this is always absolute
|
|
|
|
boost::filesystem::path _mountDir; // this is absolute iff !_mountDirIsDriveLetter
|
2020-08-01 03:08:19 +02:00
|
|
|
boost::optional<boost::filesystem::path> _configFile;
|
2015-10-15 03:38:44 +02:00
|
|
|
bool _foreground;
|
2018-02-01 11:04:59 +01:00
|
|
|
bool _allowFilesystemUpgrade;
|
2018-02-03 17:33:59 +01:00
|
|
|
bool _allowReplacedFilesystem;
|
2020-08-01 03:08:19 +02:00
|
|
|
bool _createMissingBasedir;
|
|
|
|
bool _createMissingMountpoint;
|
|
|
|
boost::optional<double> _unmountAfterIdleMinutes;
|
|
|
|
boost::optional<boost::filesystem::path> _logFile;
|
2015-10-30 19:53:15 +01:00
|
|
|
boost::optional<std::string> _cipher;
|
2016-03-04 23:12:41 +01:00
|
|
|
boost::optional<uint32_t> _blocksizeBytes;
|
2020-08-01 03:08:19 +02:00
|
|
|
bool _allowIntegrityViolations;
|
2016-06-27 07:07:58 +02:00
|
|
|
boost::optional<bool> _missingBlockIsIntegrityViolation;
|
2016-05-10 01:07:02 +02:00
|
|
|
std::vector<std::string> _fuseOptions;
|
2020-08-01 03:08:19 +02:00
|
|
|
bool _mountDirIsDriveLetter;
|
2015-10-17 21:33:41 +02:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ProgramOptions);
|
2015-09-29 14:29:10 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|