Add Explorer Workbench with hierarchical, off-UI Storage analysis.
Storage queries run in the background with cancellation and covering indexes so switching views no longer freezes the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
34
src/Explorer.Domain/NameNormalizer.cs
Normal file
34
src/Explorer.Domain/NameNormalizer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Explorer.Domain;
|
||||
|
||||
public static class NameNormalizer
|
||||
{
|
||||
public static string Normalize(string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var form = name.Normalize(NormalizationForm.FormC);
|
||||
return form.ToLower(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string? Extension(string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var idx = name.LastIndexOf('.');
|
||||
if (idx <= 0 || idx == name.Length - 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Normalize(name[(idx + 1)..]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user