| 52 | } |
| 53 | |
| 54 | void StringStorageBase::Save() const |
| 55 | { |
| 56 | try |
| 57 | { |
| 58 | FileWriter file(m_path); |
| 59 | for (auto const & value : m_values) |
| 60 | { |
| 61 | std::string line(value.first); |
| 62 | line += kKeyValueDelimChar; |
| 63 | line += value.second; |
| 64 | line += '\n'; |
| 65 | file.Write(line.data(), line.size()); |
| 66 | } |
| 67 | } |
| 68 | catch (RootException const & ex) |
| 69 | { |
| 70 | // Ignore all settings saving exceptions. |
| 71 | LOG(LWARNING, ("Saving settings:", ex.Msg())); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | void StringStorageBase::Clear() |
| 76 | { |