Introduce StringBuilder.appendLine in stdlib-common #KT-37839 (#4068)
(cherry picked from commit d0566e52051981caeffaa9f09a83f7028a9f485c)
This commit is contained in:
committed by
Vasily Levchenko
parent
32eaa2611a
commit
9021273001
@@ -5,14 +5,63 @@
|
||||
|
||||
package kotlin.text
|
||||
|
||||
fun StringBuilder.appendln(it: String) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Boolean) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Byte) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Short) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Int) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Long) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Float) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Double) = append(it).appendln()
|
||||
fun StringBuilder.appendln(it: Any?) = append(it).appendln()
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Byte): StringBuilder = append(value).appendLine()
|
||||
|
||||
fun StringBuilder.appendln() = append('\n')
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Short): StringBuilder = append(value).appendLine()
|
||||
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Int): StringBuilder = append(value).appendLine()
|
||||
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Long): StringBuilder = append(value).appendLine()
|
||||
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Float): StringBuilder = append(value).appendLine()
|
||||
|
||||
/** Appends [value] to this [StringBuilder], followed by a line feed character (`\n`). */
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun StringBuilder.appendLine(value: Double): StringBuilder = append(value).appendLine()
|
||||
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: String): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Boolean): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Byte): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Short): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Int): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Long): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Float): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Double): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine(it)"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(it: Any?): StringBuilder = appendLine(it)
|
||||
|
||||
@Deprecated("Use appendLine instead", ReplaceWith("appendLine()"), level = DeprecationLevel.WARNING)
|
||||
public fun StringBuilder.appendln(): StringBuilder = appendLine()
|
||||
Reference in New Issue
Block a user