Removed extension methods as they are part of corelib now

This commit is contained in:
Simon Lübeß
2026-08-16 22:25:37 +02:00
parent c81e695981
commit 7b82e738eb
2 changed files with 0 additions and 59 deletions
@@ -2,16 +2,6 @@ namespace System
{
public extension Array1<T>
{
/// Returns the index of the given element or -1 if it is not in this array.
public int IndexOf(T element)
{
for(int i < mLength)
if(Ptr[i] == element)
return i;
return -1;
}
/**
* Uses Binary Search to find the index of the given Element.
* @param element The element whose element will be returned.
@@ -10,53 +10,4 @@ extension Directory
// TODO: This is obviously windows only
return PathIsDirectoryEmptyW(fileName.ToScopedNativeWChar!());
}
public static Result<void, Platform.BfpFileResult> Copy(StringView fromPath, StringView toPath)
{
if (fromPath.Length <= 2)
return .Err(.InvalidParameter);
if ((fromPath[0] != '/') && (fromPath[0] != '\\'))
{
if (fromPath[1] == ':')
{
if (fromPath.Length < 3)
return .Err(.InvalidParameter);
}
}
if (!Directory.Exists(fromPath))
return .Err(.NotFound);
Try!(Directory.CreateDirectory(toPath));
for (var directoryEntry in Directory.EnumerateDirectories(fromPath))
{
let dirFromPath = scope String();
directoryEntry.GetFilePath(dirFromPath);
let dirName = scope String();
directoryEntry.GetFileName(dirName);
let dirToPath = scope String();
Path.Combine(dirToPath, toPath, dirName);
Try!(Copy(dirFromPath, dirToPath));
}
for (var fileEntry in Directory.EnumerateFiles(fromPath))
{
let fileFromPath = scope String();
fileEntry.GetFilePath(fileFromPath);
let fileName = scope String();
fileEntry.GetFileName(fileName);
let fileToPath = scope String();
Path.Combine(fileToPath, toPath, fileName);
Try!(File.Copy(fileFromPath, fileToPath));
}
return .Ok;
}
}