doobie.util.pos.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doobie-core-cats_2.11 Show documentation
Show all versions of doobie-core-cats_2.11 Show documentation
Pure functional JDBC layer for Scala.
The newest version!
package doobie.util
/** Module for source positions. */
object pos {
/** A source position. */
case class Pos(path: String, line: Int) {
def file: String =
path.lastIndexOf(java.io.File.separatorChar) match {
case -1 => path
case n => path.substring(n + 1)
}
override def toString =
s"$file:$line"
}
object Pos {
/** A `Pos` can be forged on demand. */
implicit def sourcePos(implicit ef: sourcecode.File, el: sourcecode.Line): Pos =
Pos(ef.value, el.value)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy