withStringValue static method

PersistentMap<String, String> withStringValue(
  1. File file, {
  2. bool create = false,
})

Create a PersistentMap with strings for keys and values, with file being the database file, and create specifying whether to create a new file if it doesn't exist. If file already exists, the file will not be overwritten, but rather opened. If file contains and incompatible database, behavior is unspecified.

Implementation

static PersistentMap<String, String> withStringValue(final File file,
    {bool create = false}) {
  return make<String, String>(
      file,
      (key) => convert.utf8.encoder.convert(key),
      (bytes) => convert.utf8.decode(bytes),
      (value) => convert.utf8.encoder.convert(value),
      (bytes) => convert.utf8.decode(bytes),
      create: create);
}