#include <ClamdConfig.hpp>
Classes | |
| struct | Line |
Public Member Functions | |
| ClamdConfig ()=default | |
| bool | load (const std::string &path) |
| bool | save (const std::string &path) |
| bool | saveWithBackup (const std::string &path) |
| void | setOption (const std::string &key, const std::string &value) |
| std::string | getOption (const std::string &key) const |
| bool | getOptionBool (const std::string &key) const |
| void | setOptionBool (const std::string &key, bool enabled) |
| std::vector< std::string > | getOnAccessPaths () const |
| void | addOnAccessPath (const std::string &path) |
| void | removeOnAccessPath (const std::string &path) |
| std::map< std::string, bool > | getScanOptions () const |
| void | setScanOption (const std::string &key, bool enabled) |
Private Member Functions | |
| bool | backupFile (const std::string &path) const |
Static Private Member Functions | |
| static bool | isYes (const std::string &v) |
Private Attributes | |
| std::map< std::string, std::string > | options |
| std::vector< Line > | rawLines |
Definition at line 26 of file ClamdConfig.hpp.
|
default |
| void ClamdConfig::addOnAccessPath | ( | const std::string & | path | ) |
Definition at line 143 of file ClamdConfig.cpp.
References ClamdConfig::Line::commented, ClamdConfig::Line::key, options, rawLines, ClamdConfig::Line::text, and ClamdConfig::Line::value.
Referenced by ClamdConfig(), and SettingsPage::onAddPath().
|
private |
Definition at line 90 of file ClamdConfig.cpp.
References _.
Referenced by saveWithBackup().
| std::vector< std::string > ClamdConfig::getOnAccessPaths | ( | ) | const |
Definition at line 133 of file ClamdConfig.cpp.
References rawLines.
Referenced by ClamdConfig(), and SettingsPage::SettingsPage().
| std::string ClamdConfig::getOption | ( | const std::string & | key | ) | const |
| bool ClamdConfig::getOptionBool | ( | const std::string & | key | ) | const |
Definition at line 123 of file ClamdConfig.cpp.
References isYes(), and options.
Referenced by ClamdConfig().
| std::map< std::string, bool > ClamdConfig::getScanOptions | ( | ) | const |
Definition at line 162 of file ClamdConfig.cpp.
References isYes(), and rawLines.
Referenced by ClamdConfig(), and SettingsPage::SettingsPage().
|
staticprivate |
Definition at line 185 of file ClamdConfig.cpp.
Referenced by getOptionBool(), and getScanOptions().
| bool ClamdConfig::load | ( | const std::string & | path | ) |
Definition at line 33 of file ClamdConfig.cpp.
References ClamdConfig::Line::commented, ClamdConfig::Line::key, options, rawLines, ClamdConfig::Line::text, and ClamdConfig::Line::value.
Referenced by ClamdConfig(), and MainWindow::MainWindow().
| void ClamdConfig::removeOnAccessPath | ( | const std::string & | path | ) |
Definition at line 154 of file ClamdConfig.cpp.
References rawLines.
Referenced by ClamdConfig(), and SettingsPage::onRemovePath().
| bool ClamdConfig::save | ( | const std::string & | path | ) |
Definition at line 69 of file ClamdConfig.cpp.
References options, and rawLines.
Referenced by ClamdConfig(), SettingsPage::onSave(), and saveWithBackup().
| bool ClamdConfig::saveWithBackup | ( | const std::string & | path | ) |
Definition at line 106 of file ClamdConfig.cpp.
References _, backupFile(), and save().
Referenced by ClamdConfig().
| void ClamdConfig::setOption | ( | const std::string & | key, |
| const std::string & | value ) |
| void ClamdConfig::setOptionBool | ( | const std::string & | key, |
| bool | enabled ) |
| void ClamdConfig::setScanOption | ( | const std::string & | key, |
| bool | enabled ) |
Definition at line 175 of file ClamdConfig.cpp.
References options, and rawLines.
Referenced by ClamdConfig(), and SettingsPage::onSave().
|
private |
Definition at line 62 of file ClamdConfig.hpp.
Referenced by addOnAccessPath(), getOption(), getOptionBool(), load(), save(), setOption(), setOptionBool(), and setScanOption().
|
private |
Definition at line 63 of file ClamdConfig.hpp.
Referenced by addOnAccessPath(), getOnAccessPaths(), getScanOptions(), load(), removeOnAccessPath(), save(), and setScanOption().