11namespace tracktion {
inline namespace engine
14juce::File getNonExistentSiblingWithIncrementedNumberSuffix (
const juce::File& file,
bool addHashSymbol)
16 if (! file.existsAsFile())
22 bool foundDigit =
false;
23 bool foundHash = ! addHashSymbol;
25 for (
int i = name.length(); --i >= 0;)
27 if (name[i] ==
'#' && foundDigit)
37 bool inForm = foundDigit && foundHash;
38 int number = inForm ? name.getTrailingIntValue() : 0;
39 name = inForm ? name.dropLastCharacters(drop).trimEnd() : name;
47 auto nameWithNumber = name + (addHashSymbol ?
" #" :
" ")
50 newFileName = file.getParentDirectory()
51 .getChildFile (nameWithNumber);
53 }
while (newFileName.
exists());
68 return dynamic_cast<FileDragList*
> (s.
description.getObject());
73 FileDragList* l =
new FileDragList();
74 l->preferredLayout = preferredLayout;
83 return create (files, peferredLayout);
void add(const ElementType &newElement)
static String createLegalFileName(const String &fileNameToFix)
bool hasFileExtension(StringRef extensionToTest) const
bool containsChar(juce_wchar character) const noexcept