| 34 | } |
| 35 | |
| 36 | bool BoxedReg::readKey(const char* path, const char* key, BString& value) { |
| 37 | bool found = false; |
| 38 | BString section = B("["); |
| 39 | section += path; |
| 40 | section += "]"; |
| 41 | section.replace("\\", "\\\\"); |
| 42 | BString searchKey = B("\""); |
| 43 | searchKey += key; |
| 44 | searchKey += "\"="; |
| 45 | |
| 46 | for (size_t i = 0; i < lines.size(); i++) { |
| 47 | BString line = lines[i]; |
| 48 | if (!found) { |
| 49 | if (line.startsWith(section)) { |
| 50 | found = true; |
| 51 | } |
| 52 | } else { |
| 53 | if (line.startsWith("[")) { |
| 54 | return false; |
| 55 | } |
| 56 | if (line.startsWith(searchKey)) { |
| 57 | value = line.substr(searchKey.length()); |
| 58 | value = value.trim(); |
| 59 | value = value.replace("\"", ""); |
| 60 | return true; |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | void BoxedReg::writeKeyDword(const char* path, const char* key, U32 value) { |
| 68 | BString v = B("dword:"); |
no test coverage detected