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

Functions

FAKER_CXX_EXPORT std::vector< std::string_view > wordVector (int numberOfWords=3)
 Generates and returns a dynamic array consisting of random lorem words.
 
FAKER_CXX_EXPORT std::string_view word ()
 Returns a random lorem word.
 
FAKER_CXX_EXPORT std::string words (unsigned numberOfWords=3)
 Returns a random lorem words.
 
FAKER_CXX_EXPORT std::string sentence (unsigned minNumberOfWords=3, unsigned maxNumberOfWords=10)
 Returns a random lorem sentence.
 
FAKER_CXX_EXPORT std::string sentences (unsigned minNumberOfSentences=2, unsigned maxNumberOfSentences=6)
 Returns a random lorem sentences.
 
FAKER_CXX_EXPORT std::string slug (unsigned numberOfWords=3)
 Generates a slugified text consisting of the given number of hyphen separated words.
 
FAKER_CXX_EXPORT std::string paragraph (unsigned minNumberOfSentences=2, unsigned maxNumberOfSentences=6)
 Returns a random lorem paragraph.
 
FAKER_CXX_EXPORT std::string paragraphs (unsigned minNumberOfParagraphs=2, unsigned maxNumberOfParagraphs=4)
 Returns a random lorem paragraphs.
 

Function Documentation

◆ paragraph()

FAKER_CXX_EXPORT std::string faker::lorem::paragraph ( unsigned minNumberOfSentences = 2,
unsigned maxNumberOfSentences = 6 )

Returns a random lorem paragraph.

Parameters
minNumberOfSentencesThe minimum number of sentences to generate. Defaults to `2`.
maxNumberOfSentencesThe maximum number of sentences to generate. Defaults to `6`.
Returns
Lorem paragraph.
faker::lorem::paragraph() // "Animi possimus nemo consequuntur ut ea et tempore unde qui. Quis corporis esse."
FAKER_CXX_EXPORT std::string paragraph(unsigned minNumberOfSentences=2, unsigned maxNumberOfSentences=6)
Returns a random lorem paragraph.

◆ paragraphs()

FAKER_CXX_EXPORT std::string faker::lorem::paragraphs ( unsigned minNumberOfParagraphs = 2,
unsigned maxNumberOfParagraphs = 4 )

Returns a random lorem paragraphs.

Parameters
minNumberOfParagraphsThe minimum number of paragraphs to generate. Defaults to `2`.
maxNumberOfParagraphsThe maximum number of paragraphs to generate. Defaults to `4`.
Returns
Lorem paragraphs separated with newlines.
// "Beatae voluptatem dicta et assumenda fugit eaque quidem consequatur. Fuga unde provident.
// Voluptatibus quo pariatur est. Doloribus commodi et et exercitationem vel et. Omnis inventore cum aut amet.
// Sapiente deleniti et. Ducimus maiores eum. Rem dolorem itaque aliquam."
FAKER_CXX_EXPORT std::string paragraphs(unsigned minNumberOfParagraphs=2, unsigned maxNumberOfParagraphs=4)
Returns a random lorem paragraphs.

◆ sentence()

FAKER_CXX_EXPORT std::string faker::lorem::sentence ( unsigned minNumberOfWords = 3,
unsigned maxNumberOfWords = 10 )

Returns a random lorem sentence.

Parameters
minNumberOfWordsThe minimum number of words to generate. Defaults to `3`.
maxNumberOfWordsThe maximum number of words to generate. Defaults to `10`.
Returns
Lorem sentence.
faker::lorem::sentence() // "Laborum voluptatem officiis est et."
FAKER_CXX_EXPORT std::string sentence(unsigned minNumberOfWords=3, unsigned maxNumberOfWords=10)
Returns a random lorem sentence.

◆ sentences()

FAKER_CXX_EXPORT std::string faker::lorem::sentences ( unsigned minNumberOfSentences = 2,
unsigned maxNumberOfSentences = 6 )

Returns a random lorem sentences.

Parameters
minNumberOfSentencesThe minimum number of sentences to generate. Defaults to `2`.
maxNumberOfSentencesThe maximum number of sentences to generate. Defaults to `6`.
Returns
Lorem sentences separated with spaces.
faker::lorem::sentences(2, 2) // "Maxime vel numquam quibusdam. Dignissimos ex molestias quam nihil occaecati
maiores."
FAKER_CXX_EXPORT std::string sentences(unsigned minNumberOfSentences=2, unsigned maxNumberOfSentences=6)
Returns a random lorem sentences.

◆ slug()

FAKER_CXX_EXPORT std::string faker::lorem::slug ( unsigned numberOfWords = 3)

Generates a slugified text consisting of the given number of hyphen separated words.

Parameters
numberOfWordsThe number of words. Defaults to `3`.
Returns
Hyphen separated words.
faker::lorem::slug(5) // "delectus-totam-iusto-itaque-placeat"
FAKER_CXX_EXPORT std::string slug(unsigned numberOfWords=3)
Generates a slugified text consisting of the given number of hyphen separated words.

◆ word()

FAKER_CXX_EXPORT std::string_view faker::lorem::word ( )

Returns a random lorem word.

Returns
Lorem word.
faker::lorem::word() // "temporibus"
FAKER_CXX_EXPORT std::string_view word()
Returns a random lorem word.

◆ words()

FAKER_CXX_EXPORT std::string faker::lorem::words ( unsigned numberOfWords = 3)

Returns a random lorem words.

Parameters
numberOfWordsThe number of words. Defaults to `3`.
Returns
Lorem words.
faker::lorem::words() // "qui praesentium pariatur"
FAKER_CXX_EXPORT std::string words(unsigned numberOfWords=3)
Returns a random lorem words.

◆ wordVector()

FAKER_CXX_EXPORT std::vector< std::string_view > faker::lorem::wordVector ( int numberOfWords = 3)

Generates and returns a dynamic array consisting of random lorem words.

Returns
A std::vector consisting of random lorem words
Parameters
numberOfWordsThe number of elements in the vector which is returned
Exceptions
std::invalid_argumentif the numberOfWords is less than 0
faker::lorem::wordVector(3) // "temporibus", "ipsum", "alias"
FAKER_CXX_EXPORT std::vector< std::string_view > wordVector(int numberOfWords=3)
Generates and returns a dynamic array consisting of random lorem words.