checkpoint
This commit is contained in:
@@ -41,20 +41,10 @@ namespace Foodsoft.Alpm
|
||||
|
||||
public void AddCacheDir(string dir) => API.WrapError(_handle, () => alpm.alpm_option_add_cachedir(_handle, dir));
|
||||
public bool RemoveCacheDir(string dir) => API.WrapErrorBool(_handle, () => alpm.alpm_option_add_cachedir(_handle, dir));
|
||||
|
||||
private readonly struct CacheDirsImpl : ICollectionImpl<string>
|
||||
{
|
||||
private readonly SafeAlpmHandle _handle;
|
||||
internal CacheDirsImpl(SafeAlpmHandle handle) => _handle = handle;
|
||||
public SafeHandle Handle => _handle;
|
||||
public IntPtr GetItems() => alpm.alpm_option_get_cachedirs(_handle);
|
||||
public string PtrToItem(IntPtr p) => Marshal.PtrToStringUTF8(p)!;
|
||||
}
|
||||
|
||||
public ICollection<string> CacheDirs
|
||||
{
|
||||
get =>
|
||||
EnumerableWrapperEx<string>.Create(_handle, alpm.alpm_option_get_cachedirs, Marshal.PtrToStringUTF8!);
|
||||
EnumerableWrapper.Create(_handle, alpm.alpm_option_get_cachedirs);
|
||||
set => Wrapper.SetStringCollection(value, _handle, (s) => alpm.alpm_option_add_cachedir(_handle, s));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user