| 52 | static FUsermapDirectory root; |
| 53 | |
| 54 | void InsertMap(int lumpnum) |
| 55 | { |
| 56 | FString filename = fileSystem.GetFileFullName(lumpnum); |
| 57 | auto path = filename.Split("/"); |
| 58 | |
| 59 | auto current = &root; |
| 60 | for (unsigned i = 0; i < path.Size() - 1; i++) |
| 61 | { |
| 62 | unsigned place = current->subdirectories.FindEx([=](const FUsermapDirectory& entry) { return entry.dirname.CompareNoCase(path[i]) == 0; }); |
| 63 | if (place == current->subdirectories.Size()) |
| 64 | { |
| 65 | place = current->subdirectories.Reserve(1); |
| 66 | current->subdirectories.Last().dirname = path[i]; |
| 67 | } |
| 68 | current = ¤t->subdirectories[place]; |
| 69 | } |
| 70 | current->entries.Reserve(1); |
| 71 | current->entries.Last().displayname = path.Last(); |
| 72 | current->entries.Last().filename = fileSystem.GetFileFullName(lumpnum); |
| 73 | current->entries.Last().container = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum)); |
| 74 | current->entries.Last().size = (int)fileSystem.FileLength(lumpnum); |
| 75 | auto mapinfo = FindMapByName(StripExtension(path.Last().GetChars()).GetChars()); |
| 76 | if (mapinfo) current->entries.Last().info = mapinfo->name; |
| 77 | } |
| 78 | |
| 79 | bool ValidateMap(int lumpnum) |
| 80 | { |
no test coverage detected