| 52 | } |
| 53 | |
| 54 | void ConfigFilePrivate::open(const std::string& path, bool readonly) |
| 55 | { |
| 56 | _readonly = readonly; |
| 57 | |
| 58 | if (_readonly) { |
| 59 | _stream.open(path, std::ios::in); |
| 60 | } |
| 61 | else { |
| 62 | _stream.open(path, std::ios::in|std::ios::out); |
| 63 | } |
| 64 | |
| 65 | if (!_stream.is_open()) { |
| 66 | throw Exception("Configuration", path, "unable to open the configuration file"); |
| 67 | } |
| 68 | |
| 69 | parse(); |
| 70 | } |
| 71 | |
| 72 | void ConfigFilePrivate::write() |
| 73 | { |
no test coverage detected