Faker C++
Loading...
Searching...
No Matches
faker::system Namespace Reference

Classes

struct  CronOptions
 
struct  NetworkInterfaceOptions
 

Enumerations

enum class  FileType {
  Application , Audio , Image , Text ,
  Video
}
 

Functions

FAKER_CXX_EXPORT std::string fileName ()
 Returns a random file name with extension.
 
FAKER_CXX_EXPORT std::string fileExtension (const std::optional< FileType > &mimeType=std::nullopt)
 Returns a file extension.
 
FAKER_CXX_EXPORT std::string commonFileName ()
 Returns a random file name with a given extension or a commonly used extension.
 
FAKER_CXX_EXPORT std::string_view commonFileExtension ()
 Returns a commonly used file extension.
 
FAKER_CXX_EXPORT std::string_view mimeType ()
 Returns a mime-type.
 
FAKER_CXX_EXPORT std::string_view fileType ()
 Returns a commonly used file type.
 
FAKER_CXX_EXPORT std::string_view directoryPath ()
 Returns a directory path.
 
FAKER_CXX_EXPORT std::string filePath ()
 Returns a file path.
 
FAKER_CXX_EXPORT std::string semver ()
 Returns a semantic version.
 
FAKER_CXX_EXPORT std::string networkInterface (const std::optional< NetworkInterfaceOptions > &options={})
 Returns a random network interface.
 
FAKER_CXX_EXPORT std::string cron (const CronOptions &options={})
 Returns a random cron expression.
 

Enumeration Type Documentation

◆ FileType

enum class faker::system::FileType
strong
Enumerator
Application 
Audio 
Image 
Text 
Video 

Function Documentation

◆ commonFileExtension()

FAKER_CXX_EXPORT std::string_view faker::system::commonFileExtension ( )

Returns a commonly used file extension.

Returns
A commonly used file extension.

◆ commonFileName()

FAKER_CXX_EXPORT std::string faker::system::commonFileName ( )

Returns a random file name with a given extension or a commonly used extension.

Returns
A random file name with a given extension or a commonly used extension.

◆ cron()

FAKER_CXX_EXPORT std::string faker::system::cron ( const CronOptions & options = {})

Returns a random cron expression.

Parameters
optionsThe options to use. Defaults to an empty options structure
See also
CronOptions.h.
Parameters
options.includeYearWhether to include a year in the generated expression. Defaults to `false`.
options.includeNonStandardWhether to include a @yearly, @monthly, @daily, etc text labels in the generated expression. Defaults to `false`.
Returns
A random cron expression.

◆ directoryPath()

FAKER_CXX_EXPORT std::string_view faker::system::directoryPath ( )

Returns a directory path.

Returns
A directory path.

◆ fileExtension()

FAKER_CXX_EXPORT std::string faker::system::fileExtension ( const std::optional< FileType > & mimeType = std::nullopt)

Returns a file extension.

Parameters
mimeTypevalue of MimeType enum.
Returns
A file extension.

◆ fileName()

FAKER_CXX_EXPORT std::string faker::system::fileName ( )

Returns a random file name with extension.

Returns
Random file name with extension.

◆ filePath()

FAKER_CXX_EXPORT std::string faker::system::filePath ( )

Returns a file path.

Returns
A file path.

◆ fileType()

FAKER_CXX_EXPORT std::string_view faker::system::fileType ( )

Returns a commonly used file type.

Returns
A commonly used file type.

◆ mimeType()

FAKER_CXX_EXPORT std::string_view faker::system::mimeType ( )

Returns a mime-type.

Returns
A mime-type.

◆ networkInterface()

FAKER_CXX_EXPORT std::string faker::system::networkInterface ( const std::optional< NetworkInterfaceOptions > & options = {})

Returns a random network interface.

Parameters
optionsThe options to use. Defaults to an empty options structure
See also
NetworkInterfaceOptions.h.
Parameters
options.interfaceTypeThe interface type. Can be one of `en`, `wl`, `ww`.
options.interfaceSchemaThe interface schema. Can be one of `index`, `slot`, `mac`, `pci`.
Returns
A random network interface.

◆ semver()

FAKER_CXX_EXPORT std::string faker::system::semver ( )

Returns a semantic version.

Returns
A semantic version.