lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
Loading...
Searching...
No Matches
binded.h
Go to the documentation of this file.
1
13#pragma once
14
15#ifndef LIPSUMC_BINDED_H
16# define LIPSUMC_BINDED_H
17
18// NOLINTBEGIN
19# define LPSM_USELIPSUM true
20# define LPSM_NO_USELIPSUM false
21# define LPSM_HTML true
22# define LPSM_MARKDOWN false
23# define LPSM_OBJECT true
24# define LPSM_ARRAY false
25# define LPSM_BOLD true
26# define LPSM_ITALIC false
27# define LPSM_ORDERED true
28# define LPSM_UNORDERED false
29# define LPSM_IPV4 false
30# define LPSM_IPV6 true
31# define LPSM_NOPORT false
32# define LPSM_PORT true
33// NOLINTEND
34
35# include "core.h"
36
37// NOLINTBEGIN(modernize-use-using)
38
47
57{
58 LPSM_CSC_CAMEL_CASE = 0,
59 LPSM_CSC_PASCAL_CASE,
60 LPSM_CSC_SNAKE_CASE,
61 LPSM_CSC_SHOUTY_CASE,
62 LPSM_CSC_KEBAB_CASE,
63 LPSM_CSC_TRAIN_CASE
65
75{
76 LPSM_CODEL_CPP = 0,
77 LPSM_CODEL_PYTHON,
78 LPSM_CODEL_RUST,
79 LPSM_CODEL_C,
80 LPSM_CODEL_JAVASCRIPT
82
83// NOLINTEND(modernize-use-using)
84
85# ifdef __cplusplus
86extern "C"
87{
88# endif
89
107
126 int seed);
127
143
159 const char* path);
171 int seed);
172
186 const char* setting,
187 int minValue,
188 int maxValue);
189
200
216
232
250 int num,
251 bool useLipsum);
252
270 int num,
271 bool useLipsum);
272
289 bool useLipsum);
290
308 int length,
309 char minChar,
310 char maxChar);
311
326
341
356
372 char separator);
373
389 lpsm_CaseSlugCase case_);
390
406 lpsm_CodeLanguage lang);
407
424 bool useIpv6,
425 bool usePort);
426
441
461 int num,
462 bool useLipsum,
463 bool useHtml);
464
484 int numElements,
485 bool useHtml);
504 int level,
505 bool useHtml);
506
524 bool isBold,
525 bool useHtml);
526
544 bool useHtml);
545
563 bool ordered,
564 bool useHtml);
565
582 int choices);
583
601 int maxDepth,
602 bool isObject);
603
619 int maxDepth);
620
635
636# ifdef __cplusplus
637}
638# endif
639
640#endif
LIPSUMC_API char * lpsm_Generator_case_slug(lpsm_GeneratorHandle handle, lpsm_CaseSlugCase case_)
Generate a case slug.
Definition binded.inl:134
LIPSUMC_API char * lpsm_Generator_slug(lpsm_GeneratorHandle handle, char separator)
Generate a slug.
Definition binded.inl:127
LIPSUMC_API void lpsm_Generator_load_seed(lpsm_GeneratorHandle handle, int seed)
Reload a seed.
Definition binded.inl:46
LIPSUMC_API char * lpsm_Generator_url(lpsm_GeneratorHandle handle)
Generate a URL.
Definition binded.inl:109
LIPSUMC_API char * lpsm_Generator_email(lpsm_GeneratorHandle handle)
Generate an email.
Definition binded.inl:121
LIPSUMC_API char * lpsm_Generator_sentence(lpsm_GeneratorHandle handle, int num, bool useLipsum)
Generate sentences.
Definition binded.inl:78
LIPSUMC_API char * lpsm_Generator_code(lpsm_GeneratorHandle handle, lpsm_CodeLanguage lang)
Generate a code block.
Definition binded.inl:142
LIPSUMC_API lpsm_GeneratorHandle lpsm_GeneratorSeeded(const char *path, int seed)
Create a lipsum::Generator.
Definition binded.inl:28
void * lpsm_GeneratorHandle
A handle to a lipsum::Generator.
Definition binded.h:46
LIPSUMC_API char * lpsm_Generator_fmt_list(lpsm_GeneratorHandle handle, bool ordered, bool useHtml)
Generate a Markdown or HTML list.
Definition binded.inl:207
LIPSUMC_API void lpsm_Generator_load_source(lpsm_GeneratorHandle handle, const char *path)
Reload a source.
Definition binded.inl:40
LIPSUMC_API char * lpsm_Generator_fmt_link(lpsm_GeneratorHandle handle, bool useHtml)
Generate a Markdown or HTML link.
Definition binded.inl:199
LIPSUMC_API char * lpsm_Generator_csv(lpsm_GeneratorHandle handle)
Generate a CSV document.
Definition binded.inl:234
LIPSUMC_API char * lpsm_Generator_phone_number(lpsm_GeneratorHandle handle)
Generate a phone number.
Definition binded.inl:158
LIPSUMC_API lpsm_GeneratorHandle lpsm_Generator(const char *path)
Create a lipsum::Generator.
Definition binded.inl:21
LIPSUMC_API char * lpsm_Generator_paragraph(lpsm_GeneratorHandle handle, int num, bool useLipsum)
Generate paragraphs.
Definition binded.inl:85
LIPSUMC_API char * lpsm_Generator_fmt_emphasis(lpsm_GeneratorHandle handle, bool isBold, bool useHtml)
Generate an emphasized Markdown or HTML sentence.
Definition binded.inl:190
LIPSUMC_API char * lpsm_Generator_json(lpsm_GeneratorHandle handle, int maxDepth, bool isObject)
Generate a JSON object or array.
Definition binded.inl:221
LIPSUMC_API char * lpsm_Generator_fmt_header(lpsm_GeneratorHandle handle, int level, bool useHtml)
Generate a Markdown or HTML header.
Definition binded.inl:183
LIPSUMC_API char * lpsm_Generator_word(lpsm_GeneratorHandle handle, int num)
Generate words.
Definition binded.inl:65
LIPSUMC_API char * lpsm_Generator_fragment(lpsm_GeneratorHandle handle)
Generate a sentence fragment.
Definition binded.inl:71
LIPSUMC_API char * lpsm_Generator_json_value(lpsm_GeneratorHandle handle, int maxDepth)
Generate a JSON value.
Definition binded.inl:227
LIPSUMC_API char * lpsm_Generator_ip_addr(lpsm_GeneratorHandle handle, bool useIpv6, bool usePort)
Generate an IP address.
Definition binded.inl:151
lpsm_CodeLanguage
Languages used by lpsm_Generator_code().
Definition binded.h:75
LIPSUMC_API void lpsm_GeneratorDestroy(lpsm_GeneratorHandle handle)
Delete a lipsum::Generator.
Definition binded.inl:34
LIPSUMC_API char * lpsm_Generator_fmt_text(lpsm_GeneratorHandle handle, int numElements, bool useHtml)
Generate a Markdown or HTML document.
Definition binded.inl:173
LIPSUMC_API char * lpsm_Generator_text(lpsm_GeneratorHandle handle, bool useLipsum)
Generate a random number of random paragraphs.
Definition binded.inl:92
LIPSUMC_API char * lpsm_Generator_fmt_paragraph(lpsm_GeneratorHandle handle, int num, bool useLipsum, bool useHtml)
Generate Markdown or HTML paragraphs.
Definition binded.inl:163
LIPSUMC_API void lpsm_Generator_change_setting(lpsm_GeneratorHandle handle, const char *setting, int minValue, int maxValue)
Change a setting.
Definition binded.inl:51
LIPSUMC_API char * lpsm_Generator_scramble(lpsm_GeneratorHandle handle, int length, char minChar, char maxChar)
Generate a random character scramble.
Definition binded.inl:99
LIPSUMC_API char * lpsm_Generator_xml(lpsm_GeneratorHandle handle, int choices)
Generate an XML document.
Definition binded.inl:214
LIPSUMC_API void lpsm_Generator_toggle_lazy(lpsm_GeneratorHandle handle)
Toggle the lazy flag.
Definition binded.inl:60
lpsm_CaseSlugCase
Cases used by lpsm_Generator_case_slug().
Definition binded.h:57
LIPSUMC_API char * lpsm_Generator_plain_url(lpsm_GeneratorHandle handle)
Generate a plain URL.
Definition binded.inl:115
Core macros for lipsum-cpp C wrapper.
#define LIPSUMC_API
Macro for shared libraries.
Definition core.h:39