Commit 43fa3881 authored by jiahua.liu's avatar jiahua.liu

崔崔还没有写

parent 26fc61df
......@@ -61,6 +61,14 @@ interface Config {
}
return when (file.extension.toLowerCase()) {
"json" -> JsonConfig(file)
"yml" -> YamlConfig(file)
"yaml" -> YamlConfig(file)
"mirai" -> YamlConfig(file)
"ini" -> IniConfig(file)
"toml" -> IniConfig(file)
"properties" -> IniConfig(file)
"property" -> IniConfig(file)
"data" -> IniConfig(file)
else -> error("Unsupported file config type ${file.extension.toLowerCase()}")
}
}
......@@ -328,4 +336,26 @@ class JsonConfig internal constructor(file: File) : FileConfigImpl(file) {
override fun serialize(config: ConfigSection): String {
return JSONObject.toJSONString(config)
}
}
\ No newline at end of file
}
class YamlConfig internal constructor(file: File) : FileConfigImpl(file) {
override fun deserialize(content: String): ConfigSection {
TODO("崔崔还没有写") //To change body of created functions use File | Settings | File Templates.
}
override fun serialize(config: ConfigSection): String {
TODO("崔崔还没有写") //To change body of created functions use File | Settings | File Templates.
}
}
class IniConfig internal constructor(file: File) : FileConfigImpl(file) {
override fun deserialize(content: String): ConfigSection {
TODO("崔崔还没有写") //To change body of created functions use File | Settings | File Templates.
}
override fun serialize(config: ConfigSection): String {
TODO("崔崔还没有写") //To change body of created functions use File | Settings | File Templates.
}
}
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