PlatformContext

com.ossuminc.riddl.utils.PlatformContext

This trait allows RIDDL to abstract away its IO operations. Several places in RIDDL declare a using clause with this trait in order to allow RIDDL to invoke synchronous and asynchronous I/O operations. This allows RIDDL's pure-scala implementation to be used with: JVM, scala-native, scala-js for Browser, scala-js for Node, or any other environment that supports simple input/output operations on files.

Attributes

Source
PlatformContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

The ExecutionContext that will be used for Futures and Promises

The ExecutionContext that will be used for Futures and Promises

Attributes

Source
PlatformContext.scala

Load the content of a text file asynchronously and return it as a string.

Load the content of a text file asynchronously and return it as a string. THe content, typically a RIDDL or Markdown file, is expected to be encoded in UTF-8

Value parameters

url

The URL to specify the file to load. This should specify the file:// protocol.

Attributes

Returns

The content of the file as a String, asynchronously in a Future

Source
PlatformContext.scala

The newline character for this platform

The newline character for this platform

Attributes

Source
PlatformContext.scala
def read(file: URL): String

Read the entire contents of a file and return it, synchronously

Read the entire contents of a file and return it, synchronously

Value parameters

file

The file to read.

Attributes

Returns
Source
PlatformContext.scala

Write a message to the standard output or equivalent for this platform

Write a message to the standard output or equivalent for this platform

Value parameters

message

The message to write to the standard output

Attributes

Source
PlatformContext.scala

Write a newline appended message to the stnadard output or equivalent for this platform

Write a newline appended message to the stnadard output or equivalent for this platform

Value parameters

message

The message to write to the standard output

Attributes

Source
PlatformContext.scala

Write the provided content to a file

Write the provided content to a file

Value parameters

content

The content to write

file

The file to be written.

Attributes

Source
PlatformContext.scala

Concrete methods

def log: Logger

Attributes

Source
PlatformContext.scala

The public accessor to get the current options

The public accessor to get the current options

Attributes

Source
PlatformContext.scala
def withLogger[T, L <: Logger](newLogger: L)(doIt: L => T): T

Attributes

Source
PlatformContext.scala

Do a task with a different set of options and then return to what they were

Do a task with a different set of options and then return to what they were

Attributes

Source
PlatformContext.scala

Concrete fields

protected var logger: Logger

The Logger instance to use on this platform.

The Logger instance to use on this platform.

Attributes

Source
PlatformContext.scala
protected var options_: CommonOptions

The default CommonOptions to use on this platform but not publicly available

The default CommonOptions to use on this platform but not publicly available

Attributes

Source
PlatformContext.scala

Givens

Givens

Attributes

Source
PlatformContext.scala