All Downloads are FREE. Search and download functionalities are using the official Maven repository.

butterknife.plugin.ResourceSymbolListReader.kt Maven / Gradle / Ivy

There is a newer version: 10.2.3
Show newest version
package butterknife.plugin

import java.io.File

class ResourceSymbolListReader(private val builder: FinalRClassBuilder) {

  fun readSymbolTable(symbolTable: File) {
    symbolTable.forEachLine { processLine(it) }
  }

  private fun processLine(line: String) {
    val values = line.split(' ')
    if (values.size < 4) {
      return
    }
    val javaType = values[0]
    if (javaType != "int") {
      return
    }
    val symbolType = values[1]
    if (symbolType !in SUPPORTED_TYPES) {
      return
    }
    val name = values[2]
    val value = values[3]
    builder.addResourceField(symbolType, name, value)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy