ru.pocketbyte.locolaser.mobile.resource.IosObjectiveCResources.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resource-mobile Show documentation
Show all versions of resource-mobile Show documentation
Implementation of platform for LocoLaser tool to work with Android and iOS platforms.
package ru.pocketbyte.locolaser.mobile.resource
import ru.pocketbyte.locolaser.config.resources.ResourceFileProvider
import ru.pocketbyte.locolaser.mobile.resource.file.IosObjectiveCHResourceFile
import ru.pocketbyte.locolaser.mobile.resource.file.IosObjectiveCMResourceFile
import ru.pocketbyte.locolaser.resource.Resources
import ru.pocketbyte.locolaser.resource.file.ResourceFile
import java.io.File
class IosObjectiveCResources(
resourcesDir: File,
name: String,
resourceFileProvider: ResourceFileProvider,
tableName: String?,
filter: ((key: String) -> Boolean)?
) : IosBaseClassResources(resourcesDir, name, resourceFileProvider, tableName, filter) {
companion object {
const val OBJC_H_FILE_EXTENSION = ".h"
const val OBJC_M_FILE_EXTENSION = ".m"
}
private val objcHFile: File by lazy {
getFileForLocale(Resources.BASE_LOCALE, extension = OBJC_H_FILE_EXTENSION)
}
private val objcMFile: File by lazy {
getFileForLocale(Resources.BASE_LOCALE, extension = OBJC_M_FILE_EXTENSION)
}
override val fileExtension: String = ""
override fun getResourceFiles(locales: Set?): Array {
return arrayOf(
IosObjectiveCHResourceFile(objcHFile, name),
IosObjectiveCMResourceFile(objcMFile, name, tableName)
)
}
override fun allFiles(locales: Set): List {
return listOf(objcHFile, objcMFile)
}
}