ExtFileGenerator {biodb} | R Documentation

## Extension file generator abstract class

### Description

The mother class of all file generators for biodb extension packages.

### Details

All file generator classes for biodb extensions must inherit from this class.

### Super class

`biodb::ExtGenerator` -> `ExtFileGenerator`

### Methods

#### Public methods

- `ExtFileGenerator$new()`

- `ExtFileGenerator$clone()`

Inherited methods

- `biodb::ExtGenerator$generate()`

- `biodb::ExtGenerator$upgrade()`

#### Method `new()`

Constructor

##### Usage

    ExtFileGenerator$new(
      filename = NULL,
      overwrite = FALSE,
      folder = character(),
      template = NULL,
      upgrader = c("fullReplacer", "lineAdder"),
      ...
    )

##### Arguments

`filename`

  The name of the generated file.

`overwrite`

  If set to TRUE, then overwrite existing destination file, even whatever the version of the template file. If set to FALSE, only overwrite if the version of the template file is strictly greater than the existing destination file.

`folder`

  The destination subfolder inside the package directory, as a character vector of subfolders hierarchy.

`template`

  The filename of the template to use.

`upgrader`

  The type of upgrader to use. "fullReplacer" replaces the whole destination file by the template if it is newer (it compares version numbers). "lineAdder" only adds to the destination file the missing lines from the template file.

`...`

  See the constructor of ExtGenerator for the parameters.

##### Returns

A new instance.

#### Method `clone()`

The objects of this class are cloneable with this method.

##### Usage

    ExtFileGenerator$clone(deep = FALSE)

##### Arguments

`deep`

  Whether to make a deep clone.

### Examples

    pkgFolder <- file.path(tempfile(), 'biodbFoo')
    dir.create(pkgFolder, recursive=TRUE)
    biodb::ExtConnClass$new(path=pkgFolder, dbName='foo.db',
                            dbTitle='Foo database',
                            connType='mass', remote=TRUE)$generate()

[Package biodb version 1.0.4 Index]