FileProvider {charlatan}R Documentation

FileProvider

Description

file methods

Super class

charlatan::BaseProvider -> FileProvider

Public fields

locale

(character) the locale

Methods

Public methods

Inherited methods

Method allowed_locales()

fetch the allowed locales for this provider

Usage
FileProvider$allowed_locales()

Method new()

Create a new FileProvider object

Usage
FileProvider$new(locale = NULL)
Arguments
locale

(character) the locale to use. See ⁠$allowed_locales()⁠ for locales supported (default: en_US)

Returns

A new FileProvider object


Method mime_type()

a random mime type

Usage
FileProvider$mime_type(category = NULL)
Arguments
category

(character) a mime type category of mime types, one of application, audio, image, message, model, multipart, text or video. default: NULL


Method file_name()

a random file name

Usage
FileProvider$file_name(category = NULL, extension = NULL)
Arguments
category

(character) a category of file extension type, one of audio, image, office, text or video. default: NULL. If this is given, extension is ignored

extension

(character) a file extension. if this is given, category is ignored.


Method file_extension()

a random file extension

Usage
FileProvider$file_extension(category = NULL)
Arguments
category

(character) a category of file extension type, one of audio, image, office, text or video. default: NULL


Method file_path()

a random file path

Usage
FileProvider$file_path(depth = 1, category = NULL, extension = NULL)
Arguments
depth

(character) depth of the file (depth >= 0). default: 1

category

(character) a category of file extension type, one of audio, image, office, text or video. default: NULL. If this is given, extension is ignored

extension

(character) a file extension. if this is given, category is ignored.


Method clone()

The objects of this class are cloneable with this method.

Usage
FileProvider$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

(x <- FileProvider$new())
x$locale
x$mime_type()
x$file_extension()
x$file_name()
x$file_path()
x$file_path(depth = 2)
x$file_path(depth = 3)
x$file_path(depth = 6)

[Package charlatan version 0.5.1 Index]