From 425de4ae50b0cb32cff48b91ed3d7ce68e1efb5a Mon Sep 17 00:00:00 2001 From: "jiahua.liu" Date: Fri, 14 Feb 2020 17:17:34 +0800 Subject: [PATCH] rename INI to TOML --- .../net/mamoe/mirai/plugins/ConfigSection.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt b/mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt index 2c6ab9523..6304da337 100644 --- a/mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt +++ b/mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt @@ -16,12 +16,10 @@ import com.alibaba.fastjson.parser.Feature import com.moandjiezana.toml.Toml import com.moandjiezana.toml.TomlWriter import kotlinx.serialization.* -import org.ini4j.Wini import org.yaml.snakeyaml.Yaml import java.io.File import java.util.* import java.util.concurrent.ConcurrentHashMap -import kotlin.collections.HashMap import kotlin.properties.ReadWriteProperty import kotlin.reflect.KClass import kotlin.reflect.KProperty @@ -69,11 +67,11 @@ interface Config { "yml" -> YamlConfig(file) "yaml" -> YamlConfig(file) "mirai" -> YamlConfig(file) - "ini" -> IniConfig(file) - "toml" -> IniConfig(file) - "properties" -> IniConfig(file) - "property" -> IniConfig(file) - "data" -> IniConfig(file) + "ini" -> TomlConfig(file) + "toml" -> TomlConfig(file) + "properties" -> TomlConfig(file) + "property" -> TomlConfig(file) + "data" -> TomlConfig(file) else -> error("Unsupported file config type ${file.extension.toLowerCase()}") } } @@ -398,7 +396,7 @@ class YamlConfig internal constructor(file: File) : FileConfigImpl(file) { } -class IniConfig internal constructor(file: File) : FileConfigImpl(file) { +class TomlConfig internal constructor(file: File) : FileConfigImpl(file) { override fun deserialize(content: String): ConfigSection { if (content.isEmpty() || content.isBlank()) { return ConfigSectionImpl()