126 Generator(
const std::string& path,
int seed);
205 change_setting(
const std::string& setting,
int minValue,
int maxValue);
233 std::string
word(
int num = 1);
265 std::string
sentence(
int num = 1,
bool useLipsum =
true);
283 std::string
paragraph(
int num = 1,
bool useLipsum =
true);
298 std::string
text(
bool useLipsum =
true);
322 scramble(
int length = 16,
char minChar =
' ',
char maxChar =
'~');
375 std::string
slug(
char separator =
'-');
422 std::string
ip_addr(
bool useIpv6 =
false,
bool usePort =
false);
457 fmt_paragraph(
int num = 1,
bool useLipsum =
true,
bool useHtml =
false);
484 std::string
fmt_text(
int numElements = 15,
bool useHtml =
false);
505 std::string
fmt_header(
int level = 1,
bool useHtml =
false);
526 std::string
fmt_emphasis(
bool isBold =
true,
bool useHtml =
false);
548 std::string
fmt_link(
bool useHtml =
false);
572 std::string
fmt_list(
bool ordered =
false,
bool useHtml =
false);
594 std::string
xml(
int choices = 30);
610 std::string
json(
int maxDepth = 3,
bool isObject =
true);
754 template <
internal::UniformDistributionType T>
763 if constexpr (std::is_integral_v<T>)
765 std::uniform_int_distribution<T> dist(min, max);
770 std::uniform_real_distribution<T> dist(min, max);
787 char random_number(
char min,
char max);
801 bool random_number(
bool min,
bool max);
816 int weighted_random_idx(
const std::vector<int>& weights);
Declaration of lipsum::ArgVec2.
void change_setting(const std::string &setting, const ArgVec2 &value)
Change a setting.
Definition generatorcore.inl:131
std::string xml(int choices=30)
Generate an XML document.
Definition generatorformats.inl:222
std::string ip_addr(bool useIpv6=false, bool usePort=false)
Generate an IP address.
Definition generator.inl:442
std::string fmt_emphasis(bool isBold=true, bool useHtml=false)
Generate an emphasized Markdown or HTML sentence.
Definition generatorformats.inl:145
GeneratorSettings m_Settings
Settings for generation.
Definition generator.hpp:832
std::string plain_url()
Generate a plain URL.
Definition generator.inl:190
std::string scramble(int length=16, char minChar=' ', char maxChar='~')
Generate a random character scramble.
Definition generator.inl:162
std::string fmt_paragraph(int num=1, bool useLipsum=true, bool useHtml=false)
Generate Markdown or HTML paragraphs.
Definition generatorformats.inl:27
std::string sentence(int num=1, bool useLipsum=true)
Generate sentences.
Definition generator.inl:98
std::string json_value(int maxDepth=3)
Generate a JSON value.
Definition generatorformats.inl:322
void load_seed(int seed)
Reload a seed.
Definition generatorcore.inl:125
std::string fmt_header(int level=1, bool useHtml=false)
Generate a Markdown or HTML header.
Definition generatorformats.inl:110
void toggle_lazy()
Toggle the lazy flag.
Definition generatorcore.inl:114
std::string word(int num=1)
Generate words.
Definition generator.inl:67
std::string single_sentence(const ArgVec2 &wordArg, const ArgVec2 &frag)
Generate a single sentence.
Definition generatorcore.inl:181
std::string fmt_list(bool ordered=false, bool useHtml=false)
Generate a Markdown or HTML list.
Definition generatorformats.inl:186
std::string single_fmt_paragraph(bool useLipsum, bool useHtml)
Generate a single Markdown or HTML paragraph.
Definition generatorcore.inl:210
void load_source(const std::string &path)
Reload a source.
Definition generatorcore.inl:119
std::string text(bool useLipsum=true)
Generate a random number of random paragraphs.
Definition generator.inl:151
std::string json_string()
Generate a random JSON string.
Definition generatorcore.inl:260
Source m_Source
Source used for generation.
Definition generator.hpp:844
std::string json(int maxDepth=3, bool isObject=true)
Generate a JSON object or array.
Definition generatorformats.inl:293
Generator()
Default constructor for Generator.
Definition generatorcore.inl:80
T random_number(T min, T max)
Generate a random number.
Definition generator.hpp:755
std::string fmt_link(bool useHtml=false)
Generate a Markdown or HTML link.
Definition generatorformats.inl:173
std::string url()
Generate a URL.
Definition generator.inl:184
std::string phone_number()
Generate a phone number.
Definition generator.inl:474
std::string email()
Generate an email.
Definition generator.inl:196
std::string fmt_text(int numElements=15, bool useHtml=false)
Generate a Markdown or HTML document.
Definition generatorformats.inl:53
std::string fragment()
Generate a sentence fragment.
Definition generator.inl:92
std::string csv()
Generate a CSV document.
Definition generatorformats.inl:392
std::string single_paragraph(bool useLipsum)
Generate a single paragraph.
Definition generatorcore.inl:317
std::string json_number()
Generate a random JSON number.
Definition generatorcore.inl:266
std::string code(CodeLanguage lang=CodeLanguage::Cpp)
Generate a code block.
Definition generator.inl:269
std::string slug(char separator='-')
Generate a slug.
Definition generator.inl:203
std::mt19937 m_Gen
Random number generator.
Definition generator.hpp:834
std::string case_slug(CaseSlugCase case_=CaseSlugCase::CamelCase)
Generate a case slug.
Definition generator.inl:212
std::string paragraph(int num=1, bool useLipsum=true)
Generate paragraphs.
Definition generator.inl:125
Class for multi-source generation.
Definition source.hpp:27
Core macros for lipsum-cpp.
#define LIPSUM_API
Macro for shared libraries.
Definition core.hpp:71
Struct lipsum::GeneratorSettings.
This is the main namespace of lipsum-cpp.
CodeLanguage
Languages used by lipsum::Generator::code().
Definition generator.hpp:76
GeneratorFlags
Flags for lipsum-cpp.
Definition generator.hpp:32
CaseSlugCase
Cases used by lipsum::Generator::case_slug().
Definition generator.hpp:58
Mutli-source generation for lipsum-cpp.
Store data for inputting into functions.
Definition argvec2.hpp:29
Settings for lipsum::Generator.
Definition generatorsettings.hpp:27