MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / readFile

Method readFile

src/main/java/fieldcef/plugins/OutputBox.kt:224–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 this.delegate = delegate
223 }
224 }
225
226 companion object {
227 val output = Dict.Prop<FunctionOfBoxValued<TemplateMap<Browser>>>("output")//.type<Any>()
228 .doc<FunctionOfBoxValued<TemplateMap<Browser>>>("`_.output.blah.print('something')` will print to (and, if necessary, create) an html output box")
229 .toCanon<FunctionOfBoxValued<TemplateMap<Browser>>>()
230
231 private fun readFile(s: String, append: Boolean): String {
232 try {
233 BufferedReader(FileReader(File(s))).use { r ->
234 var line = ""
235 while (r.ready()) {
236 line += """
237 ${r.readLine()}
238
239 """.trimIndent()
240 }
241 if (append) line += "\n//# sourceURL=$s"
242 return line
243 }
244 } catch (e: IOException) {

Callers 2

loadedMethod · 0.45
makeNewCanvasMethod · 0.45

Calls 2

FileFunction · 0.85
readLineMethod · 0.45

Tested by

no test coverage detected