Faker C++
Loading...
Searching...
No Matches
system.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <string>
5#include <string_view>
6
7#include "faker-cxx/export.h"
8
9namespace faker::system
10{
11enum class FileType
12{
14 Audio,
15 Image,
16 Text,
17 Video,
18};
19
20struct FAKER_CXX_EXPORT CronOptions
21{
22 bool includeYear = false;
23 bool includeNonStandard = false;
24};
25
26struct FAKER_CXX_EXPORT NetworkInterfaceOptions
27{
28 std::optional<std::string> interfaceType;
29 std::optional<std::string> interfaceSchema;
30};
31
41FAKER_CXX_EXPORT std::string fileName();
42
54FAKER_CXX_EXPORT std::string fileExtension(const std::optional<FileType>& mimeType = std::nullopt);
55
65FAKER_CXX_EXPORT std::string commonFileName();
66
76FAKER_CXX_EXPORT std::string_view commonFileExtension();
77
87FAKER_CXX_EXPORT std::string_view mimeType();
88
98FAKER_CXX_EXPORT std::string_view fileType();
99
109FAKER_CXX_EXPORT std::string_view directoryPath();
110
120FAKER_CXX_EXPORT std::string filePath();
121
131FAKER_CXX_EXPORT std::string semver();
132
159FAKER_CXX_EXPORT std::string networkInterface(const std::optional<NetworkInterfaceOptions>& options = {});
160
191FAKER_CXX_EXPORT std::string cron(const CronOptions& options = {});
192}
Definition system.h:10
FAKER_CXX_EXPORT std::string semver()
Returns a semantic version.
FAKER_CXX_EXPORT std::string filePath()
Returns a file path.
FAKER_CXX_EXPORT std::string fileName()
Returns a random file name with extension.
FAKER_CXX_EXPORT std::string_view commonFileExtension()
Returns a commonly used file extension.
FAKER_CXX_EXPORT std::string_view directoryPath()
Returns a directory path.
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 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.
FAKER_CXX_EXPORT std::string_view fileType()
Returns a commonly used file type.
FAKER_CXX_EXPORT std::string_view mimeType()
Returns a mime-type.
FAKER_CXX_EXPORT std::string fileExtension(const std::optional< FileType > &mimeType=std::nullopt)
Returns a file extension.
FileType
Definition system.h:12
Definition system.h:21
std::optional< std::string > interfaceType
Definition system.h:28
std::optional< std::string > interfaceSchema
Definition system.h:29