Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
425de4ae
Commit
425de4ae
authored
Feb 14, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename INI to TOML
parent
15c84bd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt
.../src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt
+6
-8
No files found.
mirai-console/src/main/kotlin/net/mamoe/mirai/plugins/ConfigSection.kt
View file @
425de4ae
...
@@ -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"
->
Ini
Config
(
file
)
"ini"
->
Toml
Config
(
file
)
"toml"
->
Ini
Config
(
file
)
"toml"
->
Toml
Config
(
file
)
"properties"
->
Ini
Config
(
file
)
"properties"
->
Toml
Config
(
file
)
"property"
->
Ini
Config
(
file
)
"property"
->
Toml
Config
(
file
)
"data"
->
Ini
Config
(
file
)
"data"
->
Toml
Config
(
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
Ini
Config
internal
constructor
(
file
:
File
)
:
FileConfigImpl
(
file
)
{
class
Toml
Config
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment