file methods
Super class
charlatan::BaseProvider
-> FileProvider
Methods
Inherited methods
charlatan::BaseProvider$bothify()
charlatan::BaseProvider$check_locale()
charlatan::BaseProvider$lexify()
charlatan::BaseProvider$numerify()
charlatan::BaseProvider$random_digit()
charlatan::BaseProvider$random_digit_not_zero()
charlatan::BaseProvider$random_digit_not_zero_or_empty()
charlatan::BaseProvider$random_digit_or_empty()
charlatan::BaseProvider$random_element()
charlatan::BaseProvider$random_element_prob()
charlatan::BaseProvider$random_int()
charlatan::BaseProvider$random_letter()
charlatan::BaseProvider$randomize_nb_elements()
Method new()
Create a new FileProvider
object
Usage
FileProvider$new(locale = NULL)
Method file_path()
a random file path
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 ignoredextension
(character) a file extension. if this is given,
category
is ignored.
Examples
(x <- FileProvider$new())
#> <FileProvider>
#> Inherits from: <BaseProvider>
#> Public:
#> allowed_locales: function ()
#> bothify: function (text = "## ??")
#> check_locale: function (x)
#> clone: function (deep = FALSE)
#> file_extension: function (category = NULL)
#> file_name: function (category = NULL, extension = NULL)
#> file_path: function (depth = 1, category = NULL, extension = NULL)
#> initialize: function (locale = NULL)
#> lexify: function (text = "????")
#> locale: en_US
#> mime_type: function (category = NULL)
#> numerify: function (text = "###")
#> random_digit: function ()
#> random_digit_not_zero: function ()
#> random_digit_not_zero_or_empty: function ()
#> random_digit_or_empty: function ()
#> random_element: function (x)
#> random_element_prob: function (x)
#> random_int: function (min = 0, max = 9999, size = 1)
#> random_letter: function ()
#> randomize_nb_elements: function (number = 10, le = FALSE, ge = FALSE, min = NULL, max = NULL)
#> Private:
#> application_mime_types: application/atom+xml application/ecmascript application/ ...
#> audio_file_extensions: flac mp3 wav
#> audio_mime_types: audio/basic audio/L24 audio/mp4 audio/mpeg audio/ogg aud ...
#> file_extensions: list
#> image_file_extensions: bmp gif jpeg jpg png tiff
#> image_mime_types: image/gif image/jpeg image/pjpeg image/png image/svg+xml ...
#> locales: en_US
#> message_mime_types: message/http message/imdn+xml message/partial message/rfc822
#> mime_types: list
#> model_mime_types: model/example model/iges model/mesh model/vrml model/x3d ...
#> multipart_mime_types: multipart/mixed multipart/alternative multipart/related ...
#> office_file_extensions: doc docx xls xlsx ppt pptx odt ods odp pages numbers key pdf
#> text_file_extensions: css csv html js json txt
#> text_mime_types: text/cmd text/css text/csv text/html text/javascript tex ...
#> video_file_extensions: mp4 avi mov webm
#> video_mime_types: video/mpeg video/mp4 video/ogg video/quicktime video/web ...
x$locale
#> [1] "en_US"
x$mime_type()
#> [1] "video/quicktime"
x$file_extension()
#> [1] "avi"
x$file_name()
#> [1] "free.csv"
x$file_path()
#> [1] "/medical/school.pptx"
x$file_path(depth = 2)
#> [1] "/nature/officer/it.avi"
x$file_path(depth = 3)
#> [1] "/race/control/main/answer.html"
x$file_path(depth = 6)
#> [1] "/leader/capital/hundred/most/not/visit/test.json"