MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / CompareDirectoryListing

Function CompareDirectoryListing

Source/SampleBrowser.cpp:196–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194namespace
195{
196 int CompareDirectoryListing(const String& text, const String& other)
197 {
198 if (text == other)
199 return 0;
200 bool isDir = text == ".." || File(text).isDirectory();
201 bool isOtherDir = other == ".." || File(other).isDirectory();
202 if (isDir && !isOtherDir)
203 return -1;
204 if (!isDir && isOtherDir)
205 return 1;
206 return text.compareIgnoreCase(other);
207 }
208
209 void SortDirectoryListing(StringArray& listing)
210 {

Callers 1

SortDirectoryListingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected