mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-19 09:42:11 +03:00
Windows: got rid on JNA, thus no more UnsatisfiedLinkError (at least when accessing native OS functions). Fixes #3190
This commit is contained in:
35
arduino-core/src/processing/app/windows/RegQueryParser.java
Normal file
35
arduino-core/src/processing/app/windows/RegQueryParser.java
Normal file
@ -0,0 +1,35 @@
|
||||
package processing.app.windows;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class RegQueryParser {
|
||||
|
||||
private String valueOfKey;
|
||||
|
||||
public RegQueryParser(String regQueryOutput) {
|
||||
parse(regQueryOutput);
|
||||
}
|
||||
|
||||
private void parse(String regQueryOutput) {
|
||||
List<String> rows = Arrays.asList(regQueryOutput.replace("\r", "\n").replace("\n\n", "\n").split("\n"));
|
||||
|
||||
String row = Iterables.find(rows, new Predicate<String>() {
|
||||
@Override
|
||||
public boolean apply(String input) {
|
||||
return input.startsWith(" ");
|
||||
}
|
||||
});
|
||||
|
||||
String[] cols = row.split(" ");
|
||||
assert cols.length == 4;
|
||||
this.valueOfKey = cols[3];
|
||||
}
|
||||
|
||||
public String getValueOfKey() {
|
||||
return valueOfKey;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user