1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-19 09:42:11 +03:00

Added warning for uncertified boards

This commit is contained in:
Federico Fissore
2015-03-06 12:46:21 +01:00
parent 25ddcb852f
commit 39d1dfc999
16 changed files with 573 additions and 25 deletions

View File

@ -222,12 +222,21 @@ public class PreferencesMap extends LinkedHashMap<String, String> {
* @return
*/
public PreferencesMap subTree(String parent) {
return subTree(parent, -1);
}
public PreferencesMap subTree(String parent, int sublevels) {
PreferencesMap res = new PreferencesMap();
parent += ".";
int parentLen = parent.length();
for (String key : keySet()) {
if (key.startsWith(parent))
res.put(key.substring(parentLen), get(key));
if (key.startsWith(parent)) {
String newKey = key.substring(parentLen);
int keySubLevels = newKey.split("\\.").length;
if (sublevels == -1 || keySubLevels == sublevels) {
res.put(newKey, get(key));
}
}
}
return res;
}