|
lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
|
Binded classes of lipsum-cpp C wrapper. More...
Go to the source code of this file.
Functions | |
| lpsm_GeneratorHandle | lpsm_Generator (const char *path) |
| Create a lipsum::Generator. | |
| lpsm_GeneratorHandle | lpsm_GeneratorSeeded (const char *path, int seed) |
| Create a lipsum::Generator. | |
| void | lpsm_GeneratorDestroy (lpsm_GeneratorHandle handle) |
| Delete a lipsum::Generator. | |
| void | lpsm_Generator_load_source (lpsm_GeneratorHandle handle, const char *path) |
| Reload a source. | |
| void | lpsm_Generator_load_seed (lpsm_GeneratorHandle handle, int seed) |
| Reload a seed. | |
| void | lpsm_Generator_change_setting (lpsm_GeneratorHandle handle, const char *setting, int minValue, int maxValue) |
| Change a setting. | |
| void | lpsm_Generator_toggle_lazy (lpsm_GeneratorHandle handle) |
| Toggle the lazy flag. | |
| char * | lpsm_Generator_word (lpsm_GeneratorHandle handle, int num) |
| Generate words. | |
| char * | lpsm_Generator_fragment (lpsm_GeneratorHandle handle) |
| Generate a sentence fragment. | |
| char * | lpsm_Generator_sentence (lpsm_GeneratorHandle handle, int num, bool useLipsum) |
| Generate sentences. | |
| char * | lpsm_Generator_paragraph (lpsm_GeneratorHandle handle, int num, bool useLipsum) |
| Generate paragraphs. | |
| char * | lpsm_Generator_text (lpsm_GeneratorHandle handle, bool useLipsum) |
| Generate a random number of random paragraphs. | |
| char * | lpsm_Generator_scramble (lpsm_GeneratorHandle handle, int length, char minChar, char maxChar) |
| Generate a random character scramble. | |
| char * | lpsm_Generator_url (lpsm_GeneratorHandle handle) |
| Generate a URL. | |
| char * | lpsm_Generator_plain_url (lpsm_GeneratorHandle handle) |
| Generate a plain URL. | |
| char * | lpsm_Generator_email (lpsm_GeneratorHandle handle) |
| Generate an email. | |
| char * | lpsm_Generator_slug (lpsm_GeneratorHandle handle, char separator) |
| Generate a slug. | |
| char * | lpsm_Generator_case_slug (lpsm_GeneratorHandle handle, lpsm_CaseSlugCase case_) |
| Generate a case slug. | |
| char * | lpsm_Generator_code (lpsm_GeneratorHandle handle, lpsm_CodeLanguage lang) |
| Generate a code block. | |
| char * | lpsm_Generator_ip_addr (lpsm_GeneratorHandle handle, bool useIpv6, bool usePort) |
| Generate an IP address. | |
| char * | lpsm_Generator_phone_number (lpsm_GeneratorHandle handle) |
| Generate a phone number. | |
| char * | lpsm_Generator_fmt_paragraph (lpsm_GeneratorHandle handle, int num, bool useLipsum, bool useHtml) |
| Generate Markdown or HTML paragraphs. | |
| char * | lpsm_Generator_fmt_text (lpsm_GeneratorHandle handle, int numElements, bool useHtml) |
| Generate a Markdown or HTML document. | |
| char * | lpsm_Generator_fmt_header (lpsm_GeneratorHandle handle, int level, bool useHtml) |
| Generate a Markdown or HTML header. | |
| char * | lpsm_Generator_fmt_emphasis (lpsm_GeneratorHandle handle, bool isBold, bool useHtml) |
| Generate an emphasized Markdown or HTML sentence. | |
| char * | lpsm_Generator_fmt_link (lpsm_GeneratorHandle handle, bool useHtml) |
| Generate a Markdown or HTML link. | |
| char * | lpsm_Generator_fmt_list (lpsm_GeneratorHandle handle, bool ordered, bool useHtml) |
| Generate a Markdown or HTML list. | |
| char * | lpsm_Generator_xml (lpsm_GeneratorHandle handle, int choices) |
| Generate an XML document. | |
| char * | lpsm_Generator_json (lpsm_GeneratorHandle handle, int maxDepth, bool isObject) |
| Generate a JSON object or array. | |
| char * | lpsm_Generator_json_value (lpsm_GeneratorHandle handle, int maxDepth) |
| Generate a JSON value. | |
| char * | lpsm_Generator_csv (lpsm_GeneratorHandle handle) |
| Generate a CSV document. | |
Binded classes of lipsum-cpp C wrapper.
This defines functions in binded classes in the C wrapper. This file is under the BSD Zero-Clause License.
| lpsm_GeneratorHandle lpsm_Generator | ( | const char * | path | ) |
Create a lipsum::Generator.
This function creates a pointer pointing to a lipsum::Generator.
| path | The filepath or name of the lorem ipsum source. |
| char * lpsm_Generator_case_slug | ( | lpsm_GeneratorHandle | handle, |
| lpsm_CaseSlugCase | case_ ) |
Generate a case slug.
Call lipsum::Generator::case_slug() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| case_ | The case. |
| void lpsm_Generator_change_setting | ( | lpsm_GeneratorHandle | handle, |
| const char * | setting, | ||
| int | minValue, | ||
| int | maxValue ) |
Change a setting.
Call lipsum::Generator::change_setting() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| setting | The name of the setting. |
| minValue | The new minimum value of the setting. |
| maxValue | The new maximum value of the setting. |
| char * lpsm_Generator_code | ( | lpsm_GeneratorHandle | handle, |
| lpsm_CodeLanguage | lang ) |
Generate a code block.
Call lipsum::Generator::code() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| lang | The language chosen. |
| char * lpsm_Generator_csv | ( | lpsm_GeneratorHandle | handle | ) |
Generate a CSV document.
Call lipsum::Generator::csv() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_email | ( | lpsm_GeneratorHandle | handle | ) |
Generate an email.
Call lipsum::Generator::email() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_fmt_emphasis | ( | lpsm_GeneratorHandle | handle, |
| bool | isBold, | ||
| bool | useHtml ) |
Generate an emphasized Markdown or HTML sentence.
Call lipsum::Generator::fmt_emphasis() on the specified handle. Formerly known as lpsm_Generator_md_emphasis().
| handle | The lpsm_GeneratorHandle to use. |
| isBold | Whether the sentence is bold or italic. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fmt_header | ( | lpsm_GeneratorHandle | handle, |
| int | level, | ||
| bool | useHtml ) |
Generate a Markdown or HTML header.
Call lipsum::Generator::fmt_header() on the specified handle. Formerly known as lpsm_Generator_md_header().
| handle | The lpsm_GeneratorHandle to use. |
| level | The level of the heading. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fmt_link | ( | lpsm_GeneratorHandle | handle, |
| bool | useHtml ) |
Generate a Markdown or HTML link.
Call lipsum::Generator::fmt_link() on the specified handle. Formerly known as lpsm_Generator_md_link().
| handle | The lpsm_GeneratorHandle to use. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fmt_list | ( | lpsm_GeneratorHandle | handle, |
| bool | ordered, | ||
| bool | useHtml ) |
Generate a Markdown or HTML list.
Call lipsum::Generator::fmt_list() on the specified handle. Formerly known as lpsm_Generator_md_list().
| handle | The lpsm_GeneratorHandle to use. |
| ordered | Whether the list is ordered. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fmt_paragraph | ( | lpsm_GeneratorHandle | handle, |
| int | num, | ||
| bool | useLipsum, | ||
| bool | useHtml ) |
Generate Markdown or HTML paragraphs.
Call lipsum::Generator::fmt_paragraph() on the specified handle. Formerly known as lpsm_Generator_md_paragraph().
| handle | The lpsm_GeneratorHandle to use. |
| num | The number of paragraphs. |
| useLipsum | Whether "Lorem ipsum..." should start the paragraph. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fmt_text | ( | lpsm_GeneratorHandle | handle, |
| int | numElements, | ||
| bool | useHtml ) |
Generate a Markdown or HTML document.
Call lipsum::Generator::fmt_text() on the specified handle. Formerly known as lpsm_Generator_md_text().
| handle | The lpsm_GeneratorHandle to use. |
| numElements | The number of elements (paragraph, list, heading) in the document. |
| useHtml | Whether HTML should be outputted instead of Markdown. |
| char * lpsm_Generator_fragment | ( | lpsm_GeneratorHandle | handle | ) |
Generate a sentence fragment.
Call lipsum::Generator::fragment() on the specified handle. Formerly lpsm_Generator_sentence_fragment().
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_ip_addr | ( | lpsm_GeneratorHandle | handle, |
| bool | useIpv6, | ||
| bool | usePort ) |
Generate an IP address.
Call lipsum::Generator::ip_addr() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| useIpv6 | Whether to use IPv6. |
| usePort | Whether to add a port. |
| char * lpsm_Generator_json | ( | lpsm_GeneratorHandle | handle, |
| int | maxDepth, | ||
| bool | isObject ) |
Generate a JSON object or array.
Call lipsum::Generator::json() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| maxDepth | Maximum depth of recursion. |
| isObject | Whether to output an object (true) or an array (false). |
| char * lpsm_Generator_json_value | ( | lpsm_GeneratorHandle | handle, |
| int | maxDepth ) |
Generate a JSON value.
Call lipsum::Generator::json_value() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| maxDepth | The maximum level of recursion. |
| void lpsm_Generator_load_seed | ( | lpsm_GeneratorHandle | handle, |
| int | seed ) |
Reload a seed.
Reload the seed of m_Gen.
| handle | The lpsm_GeneratorHandle to use. |
| seed | The seed specified. |
| void lpsm_Generator_load_source | ( | lpsm_GeneratorHandle | handle, |
| const char * | path ) |
Reload a source.
Reload the specified lorem ipsum source into m_Source. If path is invalid, it will print a warning and default to the standard lorem-ipsum source.
| handle | The lpsm_GeneratorHandle to use. |
| path | The filepath or name of the lorem ipsum source. |
| char * lpsm_Generator_paragraph | ( | lpsm_GeneratorHandle | handle, |
| int | num, | ||
| bool | useLipsum ) |
Generate paragraphs.
Call lipsum::Generator::paragraph() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| num | The number of paragraphs. |
| useLipsum | Whether "Lorem ipsum..." should start the paragraph(s). |
| char * lpsm_Generator_phone_number | ( | lpsm_GeneratorHandle | handle | ) |
Generate a phone number.
Call lipsum::Generator::phone_number() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_plain_url | ( | lpsm_GeneratorHandle | handle | ) |
Generate a plain URL.
Call lipsum::Generator::plain_url() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_scramble | ( | lpsm_GeneratorHandle | handle, |
| int | length, | ||
| char | minChar, | ||
| char | maxChar ) |
Generate a random character scramble.
Call lipsum::Generator::scramble() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| length | The number of characters. |
| minChar | The lowest-valued ASCII character that can appear. |
| maxChar | The highest-valued ASCII character than can appear. |
| char * lpsm_Generator_sentence | ( | lpsm_GeneratorHandle | handle, |
| int | num, | ||
| bool | useLipsum ) |
Generate sentences.
Call lipsum::Generator::sentence() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| num | The number of sentences. |
| useLipsum | Whether "Lorem ipsum..." should start the sentence(s). |
| char * lpsm_Generator_slug | ( | lpsm_GeneratorHandle | handle, |
| char | separator ) |
Generate a slug.
Call lipsum::Generator::slug() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| separator | The separator character. |
| char * lpsm_Generator_text | ( | lpsm_GeneratorHandle | handle, |
| bool | useLipsum ) |
Generate a random number of random paragraphs.
Call lipsum::Generator::text() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| useLipsum | Whether "Lorem ipsum..." should start the paragraph(s). |
| void lpsm_Generator_toggle_lazy | ( | lpsm_GeneratorHandle | handle | ) |
Toggle the lazy flag.
Call lipsum::Generator::toggle_lazy() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_url | ( | lpsm_GeneratorHandle | handle | ) |
Generate a URL.
Call lipsum::Generator::url() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| char * lpsm_Generator_word | ( | lpsm_GeneratorHandle | handle, |
| int | num ) |
Generate words.
Call lipsum::Generator::word() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| num | The number of words. |
| char * lpsm_Generator_xml | ( | lpsm_GeneratorHandle | handle, |
| int | choices ) |
Generate an XML document.
Call lipsum::Generator::xml() on the specified handle.
| handle | The lpsm_GeneratorHandle to use. |
| choices | The number of choices (start element, end element, add data element) that are made. |
| void lpsm_GeneratorDestroy | ( | lpsm_GeneratorHandle | handle | ) |
Delete a lipsum::Generator.
This function deletes a lpsm_GeneratorHandle allocated with lpsm_Generator().
| handle | The lpsm_GeneratorHandle to delete. |
| lpsm_GeneratorHandle lpsm_GeneratorSeeded | ( | const char * | path, |
| int | seed ) |
Create a lipsum::Generator.
This function creates a pointer pointing to a lipsum::Generator.
| path | The filepath or name of the lorem ipsum source. |
| seed | The seed specified. |