diff --git a/library/src/main/ets/ImageKnife.ets b/library/src/main/ets/ImageKnife.ets index 3888631..0135ae2 100644 --- a/library/src/main/ets/ImageKnife.ets +++ b/library/src/main/ets/ImageKnife.ets @@ -380,4 +380,47 @@ export class ImageKnife { getEngineKeyImpl(): IEngineKey { return this.dispatcher.getEngineKeyImpl(); } + + // 获取磁盘和memory的情况 + public getMemoryMaxSize(): number { + if (this.memoryCache instanceof MemoryLruCache) { + return this.memoryCache.maxMemory; + } + return -1; + } + + public getCurrentMemoryCount(): number { + if (this.memoryCache instanceof MemoryLruCache) { + return this.memoryCache.size(); + } + return -1; + } + + public getCurrentMemorySize(): number { + if (this.memoryCache instanceof MemoryLruCache) { + return this.memoryCache.currentMemory; + } + return -1; + } + + public getDiskMaxSize(): number { + if (this.fileCache) { + return this.fileCache.maxMemory; + } + return -1; + } + + public getCurrentDiskCount(): number { + if (this.fileCache) { + return this.fileCache.size(); + } + return -1; + } + + public getCurrentDiskSize(): number { + if (this.fileCache) { + return this.fileCache.currentMemory; + } + return -1; + } } \ No newline at end of file