Read from a file with a bunch of attribute/value pairs that are separated by = and ignore comments with #. As of 4.0.2, set allowHex to true if hex colors are used in the file. This will disable support for comments that begin later in the line. If allowHex is false, then comments can appear later o
(File inputFile, boolean allowHex)
| 105 | * necessary for the contribution .properties files. Blank lines are ignored. |
| 106 | */ |
| 107 | static public StringDict readSettings(File inputFile, boolean allowHex) { |
| 108 | if (!inputFile.exists()) { |
| 109 | Messages.err(inputFile + " does not exist inside readSettings()"); |
| 110 | return null; |
| 111 | } |
| 112 | String[] lines = PApplet.loadStrings(inputFile); |
| 113 | if (lines == null) { |
| 114 | System.err.println("Could not read " + inputFile); |
| 115 | return null; |
| 116 | } |
| 117 | return readSettings(inputFile.toString(), lines, allowHex); |
| 118 | } |
| 119 | |
| 120 | |
| 121 | /** |
no test coverage detected