package com.narutohuo.xindazhou.core.storage

/**
 * 存储服务接口
 * 统一封装键值存储、文件存储、数据库存储
 * 
 * 所有SDK模块通过此接口进行数据存储，实现类由app模块提供
 */
interface IStorage {
    /**
     * 键值存储
     */
    fun putString(key: String, value: String)
    fun getString(key: String, defaultValue: String = ""): String
    fun putInt(key: String, value: Int)
    fun getInt(key: String, defaultValue: Int = 0): Int
    fun putBoolean(key: String, value: Boolean)
    fun getBoolean(key: String, defaultValue: Boolean = false): Boolean
    fun remove(key: String)
    fun clear()
    
    /**
     * 文件存储
     */
    fun saveFile(path: String, data: ByteArray): Boolean
    fun readFile(path: String): ByteArray?
    fun deleteFile(path: String): Boolean
}

