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
43fa3881
Commit
43fa3881
authored
Feb 13, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
崔崔还没有写
parent
26fc61df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
mirai-console/src/main/kotlin/net/mamoe/mirai/plugin/ConfigSection.kt
...e/src/main/kotlin/net/mamoe/mirai/plugin/ConfigSection.kt
+31
-1
No files found.
mirai-console/src/main/kotlin/net/mamoe/mirai/plugin/ConfigSection.kt
View file @
43fa3881
...
...
@@ -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.
}
}
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