MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / addFileAtIndex

Method addFileAtIndex

JUCE/extras/Projucer/Source/Project/jucer_Project.cpp:1855–1879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1853}
1854
1855bool 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
1881bool Project::Item::addFileRetainingSortOrder (const File& file, bool shouldCompile)
1882{

Callers 4

addFilesFunction · 0.80
addBrowseableCodeMethod · 0.80
addFilesAtIndexMethod · 0.80

Calls 12

FileClass · 0.85
startsWithCharMethod · 0.80
findItemForFileMethod · 0.80
getMainGroupMethod · 0.80
isHiddenMethod · 0.45
getFileNameMethod · 0.45
isDirectoryMethod · 0.45
isValidMethod · 0.45
getFileMethod · 0.45
existsAsFileMethod · 0.45

Tested by

no test coverage detected