MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / readKey

Method readKey

source/ui/data/boxedReg.cpp:36–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool 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
67void BoxedReg::writeKeyDword(const char* path, const char* key, U32 value) {
68 BString v = B("dword:");

Callers 6

isGDIMethod · 0.80
getRendererMethod · 0.80
getVideoMemorySizeMethod · 0.80
getMouseWarpOverrideMethod · 0.80
getWindowsVersion2Method · 0.80
getWindowsVersionMethod · 0.80

Calls 7

BFunction · 0.85
replaceMethod · 0.80
startsWithMethod · 0.80
substrMethod · 0.80
trimMethod · 0.80
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected