using System;
using dnlib.DotNet;
using dnlib.DotNet.Emit;
namespace Confuser.Core.API {
///
/// A data store.
///
public interface IDataStore {
///
/// Gets the priority of this data store; higher priority means it
/// would be tried earlier.
///
/// The priority of this data store.
int Priority { get; }
///
/// Gets the number of keys this predicate has.
///
///
/// Keys are used by the data store to encrypt data/whatever purpose.
///
/// The number of keys this data store has.
int KeyCount { get; }
///
/// Determines whether this data store can be used in the specified method.
///
/// The method.
/// true if this data store can be used in the specified method; otherwise, false.
bool IsUsable(MethodDef method);
///
/// Creates an accessor of this data store for the specified method.
///
/// The method.
/// The keys.
/// The data to store.
/// A newly accessor of this data store.
IDataStoreAccessor CreateAccessor(MethodDef method, uint[] keys, byte[] data);
}
///
/// An accessor of data store.
///
public interface IDataStoreAccessor {
///
/// Emits the runtime instruction sequence for this accessor.
///
/// An instruction sequence that returns the stored data.
Instruction[] Emit();
}
}