| 1853 | } |
| 1854 | |
| 1855 | bool Project::Item::addFileAtIndex (const File& file, int insertIndex, const bool shouldCompile) |
| 1856 | { |
| 1857 | if (file == File() || file.isHidden() || file.getFileName().startsWithChar ('.')) |
| 1858 | return false; |
| 1859 | |
| 1860 | if (file.isDirectory()) |
| 1861 | { |
| 1862 | auto group = addNewSubGroup (file.getFileName(), insertIndex); |
| 1863 | |
| 1864 | for (const auto& iter : RangedDirectoryIterator (file, false, "*", File::findFilesAndDirectories)) |
| 1865 | if (! project.getMainGroup().findItemForFile (iter.getFile()).isValid()) |
| 1866 | group.addFileRetainingSortOrder (iter.getFile(), shouldCompile); |
| 1867 | } |
| 1868 | else if (file.existsAsFile()) |
| 1869 | { |
| 1870 | if (! project.getMainGroup().findItemForFile (file).isValid()) |
| 1871 | addFileUnchecked (file, insertIndex, shouldCompile); |
| 1872 | } |
| 1873 | else |
| 1874 | { |
| 1875 | jassertfalse; |
| 1876 | } |
| 1877 | |
| 1878 | return true; |
| 1879 | } |
| 1880 | |
| 1881 | bool Project::Item::addFileRetainingSortOrder (const File& file, bool shouldCompile) |
| 1882 | { |
no test coverage detected