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#include "faker-cxx/Export.h"
7
8namespace faker::system
9{
10struct FAKER_CXX_EXPORT FileOptions
11{
12 int extensionCount = 1;
13
14 struct
15 {
16 int min = 1;
17 int max = 1;
18 } extensionRange;
19};
20
21enum class FileType
22{
24 Audio,
25 Image,
26 Text,
27 Video,
28};
29
30struct FAKER_CXX_EXPORT CronOptions
31{
32 bool includeYear = false;
33 bool includeNonStandard = false;
34};
35
36struct FAKER_CXX_EXPORT NetworkInterfaceOptions
37{
38 std::optional<std::string> interfaceType;
39 std::optional<std::string> interfaceSchema;
40};
41
61FAKER_CXX_EXPORT std::string fileName(const FileOptions& options = {});
62
74FAKER_CXX_EXPORT std::string fileExtension(const std::optional<FileType>& mimeType = std::nullopt);
75
88FAKER_CXX_EXPORT std::string commonFileName(const std::optional<std::string>& ext = std::nullopt);
89
99FAKER_CXX_EXPORT std::string_view commonFileExtension();
100
110FAKER_CXX_EXPORT std::string_view mimeType();
111
121FAKER_CXX_EXPORT std::string_view fileType();
122
132FAKER_CXX_EXPORT std::string_view directoryPath();
133
143FAKER_CXX_EXPORT std::string filePath();
144
154FAKER_CXX_EXPORT std::string semver();
155
182FAKER_CXX_EXPORT std::string networkInterface(const std::optional<NetworkInterfaceOptions>& options = {});
183
214FAKER_CXX_EXPORT std::string cron(const CronOptions& options = {});
215}
Definition System.h:9
FAKER_CXX_EXPORT std::string semver()
FAKER_CXX_EXPORT std::string filePath()
FAKER_CXX_EXPORT std::string commonFileName(const std::optional< std::string > &ext=std::nullopt)
FAKER_CXX_EXPORT std::string fileName(const FileOptions &options={})
Returns a random file name with extension.
FAKER_CXX_EXPORT std::string_view commonFileExtension()
FAKER_CXX_EXPORT std::string_view directoryPath()
FAKER_CXX_EXPORT std::string networkInterface(const std::optional< NetworkInterfaceOptions > &options={})
FAKER_CXX_EXPORT std::string cron(const CronOptions &options={})
FAKER_CXX_EXPORT std::string_view fileType()
FAKER_CXX_EXPORT std::string_view mimeType()
FAKER_CXX_EXPORT std::string fileExtension(const std::optional< FileType > &mimeType=std::nullopt)
Returns a file extension.
FileType
Definition System.h:22
Definition System.h:31
Definition System.h:11
std::optional< std::string > interfaceType
Definition System.h:38
std::optional< std::string > interfaceSchema
Definition System.h:39