10 public readonly AbsolutePath? Folder;
11 public readonly
string? Name;
13 public readonly
bool IsValid =
false;
15 public UnrealSourceUnit(AbsolutePath currentFolder,
string? throwIfNotFound =
null)
17 Folder = currentFolder.FindParentOrSelf(d => d.GetFiles().Any(f => FilePredicate(f)));
18 if(throwIfNotFound !=
null && Folder ==
null)
21 throw new InvalidOperationException(throwIfNotFound);
28 var unitFile = Folder.GlobFiles(
"*")
33 Name = GetNameFromFileName(unitFile);
37 protected abstract bool FilePredicate(AbsolutePath f);
38 protected virtual string GetNameFromFileName(
string f) => f.Split(
'.').First();