ConfigDb

scala.cli.config.ConfigDb
See theConfigDb companion object
final class ConfigDb

In-memory representation of a configuration DB content.

Use ConfigDb.apply or ConfigDb.open to create an instance of it.

set, setFromString, and remove only change values in memory.

Use save to persist values on disk.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def dump: Array[Byte]

Dumps this DB content as JSON

Dumps this DB content as JSON

Attributes

def get[T](key: Key[T]): Either[ConfigDbFormatError, Option[T]]

Gets an entry.

Gets an entry.

If the value cannot be decoded, an error is returned on the left side of the either.

If the key isn't in DB, None is returned on the right side of the either.

Else, the value is returned wrapped in Some on the right side of the either.

Attributes

def getAsString[T](key: Key[T]): Either[ConfigDbFormatError, Option[Seq[String]]]

Gets an entry in printable form.

Gets an entry in printable form.

See get for when a left value, or a None on the right, can be returned.

Attributes

def remove(key: Key[_]): ConfigDb.this.type

Removes an entry from memory

Removes an entry from memory

Attributes

def save(path: Path): Either[Exception, Unit]

Saves this DB at the passed path

Saves this DB at the passed path

Attributes

def saveUnsafe(path: Path): Either[ConfigDbPermissionsError, Unit]
def set[T](key: Key[T], value: T): ConfigDb.this.type

Sets an entry in memory

Sets an entry in memory

Attributes

def setFromString[T](key: Key[T], values: Seq[String]): Either[MalformedValue, ConfigDb]

Sets an entry in memory, from a printable / user-writable representation.

Sets an entry in memory, from a printable / user-writable representation.

Attributes

Concrete fields

var rawEntries: Map[String, Array[Byte]]