-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What's done: * Changed config name to TomlConfig * Set deprecated for current KtomlConf * Modified exception classes and change `field` to `property` as the latter is preferred in Kotlin * Changed `TomlSerializationException` to `TomlDecodingException` * Migrated to TomlConfig
- Loading branch information
Peanutz_OwO
authored
Jan 15, 2022
1 parent
d953779
commit cc6e05a
Showing
36 changed files
with
391 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/KtomlConf.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/TomlConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE", "MISSING_KDOC_TOP_LEVEL") | ||
|
||
package com.akuleshov7.ktoml | ||
|
||
@Deprecated( | ||
message = "Class name changed for convention.", | ||
replaceWith = ReplaceWith("TomlConfig", "com.akuleshov7.ktoml.TomlConfig") | ||
) | ||
public class KtomlConf( | ||
ignoreUnknownNames: Boolean = false, | ||
emptyValuesAllowed: Boolean = true, | ||
escapedQuotesInLiteralStringsAllowed: Boolean = true | ||
) : TomlConfig( | ||
ignoreUnknownNames, | ||
emptyValuesAllowed, | ||
escapedQuotesInLiteralStringsAllowed | ||
) | ||
|
||
/** | ||
* @property ignoreUnknownNames - a control to allow/prohibit unknown names during the deserialization | ||
* @property allowEmptyValues - a control to allow/prohibit empty values: a = # comment | ||
* @property allowEscapedQuotesInLiteralStrings - a control to allow/prohibit escaping of single quotes in literal strings | ||
* @property indentation | ||
*/ | ||
public open class TomlConfig( | ||
public val ignoreUnknownNames: Boolean = false, | ||
public val allowEmptyValues: Boolean = true, | ||
public val allowEscapedQuotesInLiteralStrings: Boolean = true, | ||
public val indentation: Indentation = Indentation.FOUR_SPACES, | ||
) { | ||
/** | ||
* @property value | ||
*/ | ||
public enum class Indentation(public val value: String) { | ||
FOUR_SPACES(" "), | ||
NONE(""), | ||
TAB("\t"), | ||
TWO_SPACES(" "), | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.