2014-12-26 17:06:50 +03:00
|
|
|
// Copyright (c) 2012-2014 Konstantin Isakov <ikm@zbackup.org> and ZBackup contributors, see CONTRIBUTORS
|
|
|
|
// Part of ZBackup. Licensed under GNU GPLv2 or later + OpenSSL, see LICENSE
|
|
|
|
|
|
|
|
#ifndef CONFIG_HH_INCLUDED__
|
|
|
|
#define CONFIG_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <google/protobuf/text_format.h>
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
class ZConfig: public ZBackupBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ZConfig( string const & storageDir, string const & password );
|
|
|
|
|
|
|
|
// Print current configuration to screen
|
2014-12-30 17:13:48 +03:00
|
|
|
void show();
|
2014-12-26 17:06:50 +03:00
|
|
|
|
2014-12-30 19:27:31 +03:00
|
|
|
// Edit current configuration
|
2014-12-30 17:13:48 +03:00
|
|
|
// returns true if configuration is changed
|
2014-12-30 19:27:31 +03:00
|
|
|
bool editInteractively();
|
|
|
|
|
|
|
|
// Validator for user-supplied configuration
|
|
|
|
static bool validate( const string &, const string & );
|
|
|
|
|
|
|
|
static bool parse( const string & str, google::protobuf::Message * mutable_message );
|
2014-12-29 17:24:09 +03:00
|
|
|
|
2014-12-26 17:06:50 +03:00
|
|
|
private:
|
|
|
|
string toString( google::protobuf::Message const & message );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|