Commit 425de4ae authored by jiahua.liu's avatar jiahua.liu

rename INI to TOML

parent 15c84bd3
...@@ -16,12 +16,10 @@ import com.alibaba.fastjson.parser.Feature ...@@ -16,12 +16,10 @@ import com.alibaba.fastjson.parser.Feature
import com.moandjiezana.toml.Toml import com.moandjiezana.toml.Toml
import com.moandjiezana.toml.TomlWriter import com.moandjiezana.toml.TomlWriter
import kotlinx.serialization.* import kotlinx.serialization.*
import org.ini4j.Wini
import org.yaml.snakeyaml.Yaml import org.yaml.snakeyaml.Yaml
import java.io.File import java.io.File
import java.util.* import java.util.*
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import kotlin.collections.HashMap
import kotlin.properties.ReadWriteProperty import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KClass import kotlin.reflect.KClass
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
...@@ -69,11 +67,11 @@ interface Config { ...@@ -69,11 +67,11 @@ interface Config {
"yml" -> YamlConfig(file) "yml" -> YamlConfig(file)
"yaml" -> YamlConfig(file) "yaml" -> YamlConfig(file)
"mirai" -> YamlConfig(file) "mirai" -> YamlConfig(file)
"ini" -> IniConfig(file) "ini" -> TomlConfig(file)
"toml" -> IniConfig(file) "toml" -> TomlConfig(file)
"properties" -> IniConfig(file) "properties" -> TomlConfig(file)
"property" -> IniConfig(file) "property" -> TomlConfig(file)
"data" -> IniConfig(file) "data" -> TomlConfig(file)
else -> error("Unsupported file config type ${file.extension.toLowerCase()}") else -> error("Unsupported file config type ${file.extension.toLowerCase()}")
} }
} }
...@@ -398,7 +396,7 @@ class YamlConfig internal constructor(file: File) : FileConfigImpl(file) { ...@@ -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 { override fun deserialize(content: String): ConfigSection {
if (content.isEmpty() || content.isBlank()) { if (content.isEmpty() || content.isBlank()) {
return ConfigSectionImpl() return ConfigSectionImpl()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment