Read from a file with a bunch of attribute/value pairs that are separated by = and ignore comments with #. Changed in 3.x to return null (rather than empty hash) if no file, and changed return type to StringDict instead of Map or HashMap.
(File inputFile)
| 73 | * and changed return type to StringDict instead of Map or HashMap. |
| 74 | */ |
| 75 | static public StringDict readSettings(File inputFile) { |
| 76 | if (!inputFile.exists()) { |
| 77 | Messages.loge(inputFile + " does not exist inside readSettings()"); |
| 78 | return null; |
| 79 | } |
| 80 | String lines[] = PApplet.loadStrings(inputFile); |
| 81 | if (lines == null) { |
| 82 | System.err.println("Could not read " + inputFile); |
| 83 | return null; |
| 84 | } |
| 85 | return readSettings(inputFile.toString(), lines); |
| 86 | } |
| 87 | |
| 88 | |
| 89 | /** |
no test coverage detected