| 27 | |
| 28 | |
| 29 | void writeBZDB(const std::string& name, void* stream) { |
| 30 | std::ostream& s = *static_cast<std::ostream*>(stream); |
| 31 | std::string value = BZDB.get(name); |
| 32 | std::string defaultVal = BZDB.getDefault(name); |
| 33 | std::string newkey; |
| 34 | bool commentOut = (value == defaultVal); |
| 35 | |
| 36 | // quotify anything with a space and empty strings |
| 37 | if ((value.find(' ') != value.npos) || (value.size() == 0)) { |
| 38 | value = std::string("\"") + value + "\""; |
| 39 | } |
| 40 | |
| 41 | // quotify the key if there's a space |
| 42 | if (name.find(' ') != name.npos) { |
| 43 | newkey = std::string("\"") + name + "\""; |
| 44 | } |
| 45 | else { |
| 46 | newkey = name; |
| 47 | } |
| 48 | |
| 49 | s << (commentOut ? "#set " : "set ") << newkey << ' ' << value << std::endl; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | void writeKEYMGR(const std::string& name, bool press, |
nothing calls this directly
no test coverage detected