MCPcopy Index your code
hub / github.com/processing/processing / read

Method read

app/src/processing/app/Language.java:333–370  ·  view source on GitHub ↗
(File additions)

Source from the content-addressed store, hash-verified

331 }
332
333 void read(File additions) {
334 String[] lines = PApplet.loadStrings(additions);
335 if (lines == null) {
336 throw new NullPointerException("File not found:\n" + additions.getAbsolutePath());
337 }
338 //for (String line : lines) {
339 for (int i = 0; i < lines.length; i++) {
340 String line = lines[i];
341 if ((line.length() == 0) ||
342 (line.charAt(0) == '#')) continue;
343
344 // this won't properly handle = signs inside in the text
345 int equals = line.indexOf('=');
346 if (equals != -1) {
347 String key = line.substring(0, equals).trim();
348 String value = line.substring(equals + 1).trim();
349
350 /*
351 // Support for backslashes to continue lines... Nah.
352 while (line.endsWith("\\")) {
353 // remove the backslash from the previous
354 value = value.substring(0, value.length() - 1);
355 // get the next line
356 line = lines[++i].trim();
357 // append the new line to the value (with a space)
358 // This is imperfect since the prev may end <br>
359 value += " " + line;
360 }
361 */
362
363 // fix \n and \'
364 value = value.replaceAll("\\\\n", "\n");
365 value = value.replaceAll("\\\\'", "'");
366
367 table.put(key, value);
368 }
369 }
370 }
371
372 String getString(String key) {
373 return table.get(key);

Callers 10

LanguageBundleMethod · 0.95
handleClientMethod · 0.45
sendFileMethod · 0.45
loadBytesRawMethod · 0.45
copyFileMethod · 0.45
unzipEntryMethod · 0.45
copyFileMethod · 0.45
downloadMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 4

loadStringsMethod · 0.95
trimMethod · 0.45
replaceAllMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected