If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that You can even edit it inside zep for immediate changes :)
| 128 | // If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that |
| 129 | // You can even edit it inside zep for immediate changes :) |
| 130 | void ZepEditor::LoadConfig(const ZepPath& config_path) |
| 131 | { |
| 132 | if (!GetFileSystem().Exists(config_path)) |
| 133 | { |
| 134 | return; |
| 135 | } |
| 136 | |
| 137 | try |
| 138 | { |
| 139 | std::shared_ptr<cpptoml::table> spConfig; |
| 140 | spConfig = cpptoml::parse_file(config_path.string()); |
| 141 | if (spConfig == nullptr) |
| 142 | return; |
| 143 | |
| 144 | LoadConfig(spConfig); |
| 145 | } |
| 146 | catch (cpptoml::parse_exception& ex) |
| 147 | { |
| 148 | std::ostringstream str; |
| 149 | str << config_path.filename().string() << " : Failed to parse. " << ex.what(); |
| 150 | SetCommandText(str.str()); |
| 151 | } |
| 152 | catch (...) |
| 153 | { |
| 154 | std::ostringstream str; |
| 155 | str << config_path.filename().string() << " : Failed to parse. "; |
| 156 | SetCommandText(str.str()); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void ZepEditor::LoadConfig(std::shared_ptr<cpptoml::table> spConfig) |
| 161 | { |
nothing calls this directly
no test coverage detected