readText

actual fun readText(resourcePath: String): String

Reads text content from an Android asset or resource file. For Android, this function assumes the resource is an asset in the assets folder.

Note: In a real Android application, you would typically pass a Context to access assets. For a library, consider using the resource path approach or requiring the caller to provide the content directly.

Return

The text content of the asset file.

Parameters

resourcePath

The path to the asset file (e.g., "themes/light.json").

Throws

If the asset is not found.

expect fun readText(resourcePath: String): String

Reads text content from a platform-specific resource or file.

Return

The text content of the resource or file.

Parameters

resourcePath

The path to the resource or file.

actual fun readText(resourcePath: String): String

Reads text content from an iOS bundle resource. For iOS, this function assumes the resource is in the main bundle.

Return

The text content of the resource file.

Parameters

resourcePath

The path to the resource file (e.g., "light.json").

Throws

If the resource is not found.

actual fun readText(resourcePath: String): String

Reads text content from a JVM resource or file using InputStream.

Return

The text content of the resource or file.

Parameters

resourcePath

The path to the resource or file.