class OsString
source · line 7public
public class OsString private constructor(private val bytes: Array<Byte>) : Equals<OsString>, Hash
- Supertype
Equals<OsString> - Supertype
Hash
An immutable snapshot of operating-system bytes. It can represent names that are not valid UTF-8; decoding policy is explicit.
Extensions
@Unsafe public fun <R> OsString.withNativeString(block: (Ptr<Byte>) -> R): R· scoop:scoop.platform:0.1.0
function equals
source · line 37public
public override operator fun equals(other: OsString): Boolean
- Overrides
equals
Compares the exact stored byte sequences.
parameter other
source · line 37public
other: OsString
function decodeUtf8
source · line 22public
public fun decodeUtf8(): String
Decodes the stored bytes as strict UTF-8, rejecting malformed encoding.
function toUtf16
source · line 17public
public fun toUtf16(): Array<UShort>
Copies the UTF-16 code units represented by these UTF-8 or WTF-8 bytes, preserving unpaired surrogates. Malformed or noncanonical encoding throws CharacterCodingException.
function decodeUtf8Lossy
source · line 27public
public fun decodeUtf8Lossy(): String
Decodes stored bytes with replacement for malformed UTF-8.
function toByteArray
source · line 11public
public fun toByteArray(): Array<Byte>
Returns an independent copy of the stored native bytes.
function hash
source · line 42public
public override fun hash(): Long
- Overrides
hash
Hashes the stored bytes consistently with equality.
function display
source · line 32public
public fun display(): String
Returns a lossy UTF-8 presentation suitable for displaying native names.