MCPcopy
hub / github.com/arduino/Arduino / findFileIndex

Method findFileIndex

arduino-core/src/processing/app/Sketch.java:225–233  ·  view source on GitHub ↗

Finds the file with the given filename and returns its index. Returns -1 when the file was not found.

(File filename)

Source from the content-addressed store, hash-verified

223 * Returns -1 when the file was not found.
224 */
225 public int findFileIndex(File filename) {
226 int i = 0;
227 for (SketchFile file : files) {
228 if (file.getFile().equals(filename))
229 return i;
230 i++;
231 }
232 return -1;
233 }
234
235 /**
236 * Check if renaming/saving this sketch to the given folder would

Callers 1

checkNewFilenameMethod · 0.95

Calls 2

equalsMethod · 0.45
getFileMethod · 0.45

Tested by

no test coverage detected