package com.narutohuo.xindazhou.core.storage

/**
 * 存储服务接口
 * 统一封装键值存储、文件存储、数据库存储
 * 
 * 实现类：StorageImpl（在 base-core 中提供）
 * 所有模块都可以直接使用 StorageImpl 进行数据存储
 */
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 putLong(key: String, value: Long)
    fun getLong(key: String, defaultValue: Long = 0L): Long
    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
}

