blob: e95993d923ba0dd3d2982621eaf7e064a0d104a6 [file] [log] [blame] [raw]
package li.cil.oc.api.fs
object Mode extends Enumeration {
val Read = Value("Read")
val Write = Value("Write")
val Append = Value("Append")
def parse(value: String) = value match {
case "r" | "rb" => Read
case "w" | "wb" => Write
case "a" | "ab" => Append
case _ => throw new IllegalArgumentException("unsupported mode")
}
}