MCPcopy Index your code
hub / github.com/arduino/Arduino / load

Method load

arduino-core/src/processing/app/SketchFile.java:255–276  ·  view source on GitHub ↗

Load this piece of code from a file and return the contents. This completely ignores any changes in the linked storage, if any, and just directly reads the file.

()

Source from the content-addressed store, hash-verified

253 * just directly reads the file.
254 */
255 public String load() throws IOException {
256 String text = BaseNoGui.loadFile(file);
257
258 if (text == null) {
259 throw new IOException();
260 }
261
262 if (text.indexOf('\uFFFD') != -1) {
263 System.err.println(
264 I18n.format(
265 tr("\"{0}\" contains unrecognized characters. " +
266 "If this code was created with an older version of Arduino, " +
267 "you may need to use Tools -> Fix Encoding & Reload to update " +
268 "the sketch to use UTF-8 encoding. If not, you may need to " +
269 "delete the bad characters to get rid of this warning."),
270 file.getName()
271 )
272 );
273 System.err.println();
274 }
275 return text;
276 }
277
278
279 /**

Callers 2

initMethod · 0.45
loadLibMethod · 0.45

Calls 4

loadFileMethod · 0.95
formatMethod · 0.95
trMethod · 0.80
getNameMethod · 0.65

Tested by

no test coverage detected