in cassovary-core/src/main/scala/com/twitter/cassovary/util/io/FileReader.scala [40:62]
protected def processOneLine(line: String): T
// by default, to save state, we simply return x
// but this is available to be overridden should x
// be a reference that might be lost.
protected def saveCurr(x: Option[T]) = x
private def checkNext(): Option[T] = {
var found: Option[T] = None
while (lines.hasNext && found.isEmpty) {
val line = lines.next().trim
if (line.charAt(0) != '#') {
try {
found = Some(processOneLine(line))
} catch {
case NonFatal(exc) =>
throw new IOException("Parsing failed near line: %d in %s"
.format(lastLineParsed, fileName), exc)
}
}
}
found
}