libcryfs/src/cryfs-cli/program_options/ProgramOptions.cpp

74 lines
2.5 KiB
C++
Raw Normal View History

#include "ProgramOptions.h"
#include <cstring>
2016-02-11 16:39:42 +01:00
#include <cpp-utils/assert/assert.h>
using namespace cryfs::program_options;
using std::string;
using std::vector;
2015-10-17 18:31:17 +02:00
using boost::optional;
namespace bf = boost::filesystem;
2017-10-01 10:04:29 +02:00
ProgramOptions::ProgramOptions(bf::path baseDir, bf::path mountDir, optional<bf::path> configFile,
bool foreground, bool allowFilesystemUpgrade, bool allowReplacedFilesystem, optional<double> unmountAfterIdleMinutes,
2017-10-01 10:04:29 +02:00
optional<bf::path> logFile, optional<string> cipher,
optional<uint32_t> blocksizeBytes,
bool allowIntegrityViolations,
2017-10-01 10:04:29 +02:00
boost::optional<bool> missingBlockIsIntegrityViolation,
vector<string> fuseOptions)
:_baseDir(std::move(baseDir)), _mountDir(std::move(mountDir)), _configFile(std::move(configFile)), _foreground(foreground), _allowFilesystemUpgrade(allowFilesystemUpgrade), _allowReplacedFilesystem(allowReplacedFilesystem), _allowIntegrityViolations(allowIntegrityViolations),
2017-10-01 10:04:29 +02:00
_cipher(std::move(cipher)), _blocksizeBytes(std::move(blocksizeBytes)), _unmountAfterIdleMinutes(std::move(unmountAfterIdleMinutes)),
_missingBlockIsIntegrityViolation(std::move(missingBlockIsIntegrityViolation)), _logFile(std::move(logFile)), _fuseOptions(std::move(fuseOptions)) {
}
const bf::path &ProgramOptions::baseDir() const {
return _baseDir;
}
const bf::path &ProgramOptions::mountDir() const {
return _mountDir;
}
const optional<bf::path> &ProgramOptions::configFile() const {
return _configFile;
}
bool ProgramOptions::foreground() const {
return _foreground;
}
bool ProgramOptions::allowFilesystemUpgrade() const {
return _allowFilesystemUpgrade;
}
const optional<double> &ProgramOptions::unmountAfterIdleMinutes() const {
return _unmountAfterIdleMinutes;
}
const optional<bf::path> &ProgramOptions::logFile() const {
2015-10-17 18:31:17 +02:00
return _logFile;
}
const optional<string> &ProgramOptions::cipher() const {
return _cipher;
}
const optional<uint32_t> &ProgramOptions::blocksizeBytes() const {
return _blocksizeBytes;
}
bool ProgramOptions::allowIntegrityViolations() const {
return _allowIntegrityViolations;
}
bool ProgramOptions::allowReplacedFilesystem() const {
return _allowReplacedFilesystem;
}
const optional<bool> &ProgramOptions::missingBlockIsIntegrityViolation() const {
return _missingBlockIsIntegrityViolation;
}
const vector<string> &ProgramOptions::fuseOptions() const {
return _fuseOptions;
}