You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
|
|
#ifndef _CFG_H_
|
|
#define _CFG_H_
|
|
|
|
#include <string>
|
|
#define FBSH_CFGFILE ".fbsh.config"
|
|
#define FBSH_SIDFILE ".fbsh.sid"
|
|
|
|
class Config {
|
|
private:
|
|
std::string username;
|
|
std::string password;
|
|
std::string sidfile;
|
|
bool silent;
|
|
bool savepassword;
|
|
std::string fbhostname;
|
|
|
|
std::string filename; // config filename ($HOME/.fbsh.config)
|
|
std::string GetFilenameInHome();
|
|
std::string GetDefaultSIDFile();
|
|
|
|
public:
|
|
Config();
|
|
~Config();
|
|
|
|
void SetPassword(std::string psw) { if (savepassword) password = psw; };
|
|
void SetUsername(std::string user) { if (savepassword) username = user; };
|
|
void SetFBHostname(std::string fn) { fbhostname = fn; };
|
|
void SetSIDFile(std::string fn) { sidfile = fn; };
|
|
void SetFilename(std::string fn) { filename = fn; };
|
|
void SetSavePassword(bool enable);
|
|
void SetSilent(bool enable) { silent = enable; };
|
|
|
|
std::string GetPassword() { return password; };
|
|
std::string GetFBHostname() { return fbhostname; };
|
|
std::string GetUsername() { return username; };
|
|
std::string GetFilename() { return filename; };
|
|
std::string GetSIDFile() { return sidfile; };
|
|
bool GetSavePassword() { return savepassword; };
|
|
bool GetSilent() { return silent; };
|
|
|
|
int SaveConfig();
|
|
int LoadConfig();
|
|
};
|
|
|
|
|
|
#endif
|