package com.base.superfilemanager.bean

data class FileBean(
    var name: String = "",
    var path: String,
    val size: Long,
    val isDir: Boolean = false,
    val type: String = "",
    val time: Long = 0L,
    var isSelect: Boolean = false
) {
    fun isEmptyDir() = isDir

    fun isImage() = !isDir && type in listOf("png", "jpg", "gif")


    fun isVideo() = !isDir && type in listOf("mp4")

    fun isAudio() = !isDir && type in listOf("mp3")

    fun isLargeFile() = !isDir && size >= 10 * 1024 * 1024

    fun isZip() = !isDir && type in listOf("zip", "tar", "7z")

    fun isApk() = !isDir && type in listOf("apk")

    fun isDoc() = !isDir && type in listOf("pdf", "doc", "docx", "xls", "ppt", "txt")
    fun isDocx() = !isDir && type in listOf("docx")
    fun isPdf() = !isDir && type in listOf("pdf")
    fun isXls() = !isDir && type in listOf("xls", "xlsx")
    fun isTxt() = !isDir && type in listOf("txt")
    fun isPpt() = !isDir && type in listOf("ppt")
    fun isOther() = !isImage() && !isVideo() && !isAudio() && !isZip() && !isApk()
    fun isJunk() = !isDir && type in listOf("tmp", "cache", "temp")
    fun isOtherTrash() =
        !isDir && type in listOf("log", "bak", "old", "chk", "gid", "dmp", "thumb", "crdownload", "part", "trash", "trashes")
}