checkpoint
This commit is contained in:
@@ -19,20 +19,11 @@ namespace Foodsoft.Alpm
|
||||
public bool RemoveServer(string url) =>
|
||||
API.WrapErrorBool(_handle.SafeAlpmHandle, () => alpm.alpm_db_remove_server(_handle, url));
|
||||
|
||||
private readonly struct ServersImpl : ICollectionImpl<string>
|
||||
{
|
||||
private readonly SafeDatabaseHandle _handle;
|
||||
internal ServersImpl(SafeDatabaseHandle handle) => _handle = handle;
|
||||
public SafeHandle Handle => _handle;
|
||||
public IntPtr GetItems() => alpm.alpm_db_get_servers(_handle);
|
||||
public string PtrToItem(IntPtr p) => Marshal.PtrToStringUTF8(p)!;
|
||||
}
|
||||
|
||||
// FIXME: This is "bug correct", but probably dumb to do it this way, instead just call add_server
|
||||
// like all the stuff in handle.
|
||||
public IEnumerable<string> Servers
|
||||
{
|
||||
get => EnumerableWrapper<string>.Create(new ServersImpl(_handle));
|
||||
get => EnumerableWrapper.Create(_handle, alpm.alpm_db_get_servers);
|
||||
set
|
||||
{
|
||||
var listPtr = IntPtr.Zero;
|
||||
@@ -94,14 +85,14 @@ namespace Foodsoft.Alpm
|
||||
return new CachePackage(new SafeCachePackageHandle(pkgPtr, _handle), this);
|
||||
}
|
||||
|
||||
public PackageList PackageCache
|
||||
public CachePackageList CachePackageCache
|
||||
{
|
||||
get
|
||||
{
|
||||
var listPtr = alpm.alpm_db_get_pkgcache(_handle);
|
||||
if (listPtr == IntPtr.Zero)
|
||||
throw new AlpmException(_handle.SafeAlpmHandle);
|
||||
return new PackageList(listPtr, _handle, this);
|
||||
return new CachePackageList(listPtr, _handle, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user