properties.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 74 行

SCALA
74
字号
/* NSC -- new Scala compiler * Copyright 2006-2008 LAMP/EPFL * @author  Stephane Micheloud */// $Id: Properties.scala 14416 2008-03-19 01:17:25Z mihaylov $package scala.tools.nsc/** A utility to load the compiler properties from a Java properties file *  included in the jar. */object Properties {  /** The name of the properties file */  private val propFilename = "/compiler.properties"  /** The loaded properties */  private val props = {    val props = new java.util.Properties    val stream = classOf[Global].getResourceAsStream(propFilename)    if (stream != null)      props.load(stream)    props  }  val isWin = System.getProperty("os.name") startsWith "Windows"  /** The version number of the jar this was loaded from, or    * "(unknown)" if it cannot be determined.    */  val versionString: String = {    val defaultString = "(unknown)"    "version " + props.getProperty("version.number", defaultString)  }    val copyrightString: String = {    val defaultString = "(c) 2002-2008 LAMP/EPFL"    props.getProperty("copyright.string", defaultString)  }  val encodingString: String = {    val defaultString = "UTF8" //"ISO-8859-1"    props.getProperty("file.encoding", defaultString)  }  val fileEndingString: String = {    val defaultString = ".scala"    props.getProperty("file.ending", defaultString)    }  val residentPromptString: String = {    val defaultString = "\nnsc> "    props.getProperty("resident.prompt", defaultString)      }  val shellPromptString: String = {    val defaultString = "\nscala> "    props.getProperty("shell.prompt", defaultString)      }  val scalaHome: String =    System.getProperty("scala.home")  val envClasspath: String =    System.getProperty("env.classpath")  val cmdName: String =    if (isWin) "scala.bat" else "scala"  val msilILasm: String =    System.getProperty("msil.ilasm", "")}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?