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

Classes

struct  Author
 

Enumerations

enum class  BranchIssueType { WithoutIssueNumber , WithIssueNumber }
 

Functions

FAKER_CXX_EXPORT std::string branch (std::optional< BranchIssueType > issueType=std::nullopt, unsigned maxIssueNum=100)
 Returns a random branch name.
 
FAKER_CXX_EXPORT std::string commitDate (unsigned years=15)
 Generates a random date in form of string.
 
FAKER_CXX_EXPORT std::string commitEntry (std::optional< unsigned > dateYears=std::nullopt, std::optional< unsigned > shaLength=std::nullopt, Locale locale=Locale::en_US)
 Generates a random commit entry in form of string.
 
FAKER_CXX_EXPORT std::string commitMessage ()
 Generates a random commit message.
 
FAKER_CXX_EXPORT std::string commitSha (unsigned length=40)
 Returns a random SHA hash.
 

Enumeration Type Documentation

◆ BranchIssueType

enum class faker::git::BranchIssueType
strong
Enumerator
WithoutIssueNumber 
WithIssueNumber 

Function Documentation

◆ branch()

FAKER_CXX_EXPORT std::string faker::git::branch ( std::optional< BranchIssueType > issueType = std::nullopt,
unsigned maxIssueNum = 100 )

Returns a random branch name.

Parameters
issueTypeThe optional branch issue type.
maxIssueNumThe maximum issue number in branch name. Defaults to `100`.
Returns
Branch name.
faker::git::branch() // "capitalize-bus"
FAKER_CXX_EXPORT std::string branch(std::optional< BranchIssueType > issueType=std::nullopt, unsigned maxIssueNum=100)
Returns a random branch name.

◆ commitDate()

FAKER_CXX_EXPORT std::string faker::git::commitDate ( unsigned years = 15)

Generates a random date in form of string.

Parameters
yearsThe range of years the date may be in the past. Defaults to `15`.
Returns
Commit date.
faker::git::commitDate() // "Mon Jan 17 15:05:53 2022 +1100"
FAKER_CXX_EXPORT std::string commitDate(unsigned years=15)
Generates a random date in form of string.

◆ commitEntry()

FAKER_CXX_EXPORT std::string faker::git::commitEntry ( std::optional< unsigned > dateYears = std::nullopt,
std::optional< unsigned > shaLength = std::nullopt,
Locale locale = Locale::en_US )

Generates a random commit entry in form of string.

Parameters
dateYearsThe range of years the date may be in the past. Defaults to `15`.
shaLengthThe length of output SHA hash. Defaults to `40`.
localeThe locale. Defaults to `Locale::en_US`.
Returns
Commit entry.
faker::git::commitEntry() // "commit 9cbc41bb8ce0438c8de9cb25a1c6ad33441d8aca
Author: Rachel McLaughlin Rachel_McLaughlin@gmail.com
Date: Mon Jan 17 15:05:53 2022 +1100
spawn polyp"
FAKER_CXX_EXPORT std::string commitEntry(std::optional< unsigned > dateYears=std::nullopt, std::optional< unsigned > shaLength=std::nullopt, Locale locale=Locale::en_US)
Generates a random commit entry in form of string.
Definition git.h:12

◆ commitMessage()

FAKER_CXX_EXPORT std::string faker::git::commitMessage ( )

Generates a random commit message.

Returns
Commit message.
faker::git::commitMessage() // "spawn polyp"
FAKER_CXX_EXPORT std::string commitMessage()
Generates a random commit message.

◆ commitSha()

FAKER_CXX_EXPORT std::string faker::git::commitSha ( unsigned length = 40)

Returns a random SHA hash.

Parameters
lengthThe length of output SHA hash. Defaults to `40`.
Returns
SHA hash.
faker::git::commitSha() // "9cbc41bb8ce0438c8de9cb25a1c6ad33441d8aca"
FAKER_CXX_EXPORT std::string commitSha(unsigned length=40)
Returns a random SHA hash.