|
lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
|
Contains the definitions of all the C wrapper's functions. More...
Macros | |
| #define | LPSM_CPPIFY(x, type) |
Functions | |
| char * | lpsm_GenerateDefaultLipsumSentence (void) |
| Generate the beginning Lorem Ipsum sentence. | |
| const char * | lpsm_internal_Version__ () |
| Return the current version of lipsum-cpp. | |
| int | lpsm_CountWords (const char *str) |
| Count the number of words in a string. | |
| int | lpsm_CountSentenceFragments (const char *str) |
| Count the number of sentence fragments in a string. | |
| int | lpsm_CountSentences (const char *str) |
| Count the number of sentences in a string. | |
| int | lpsm_CountParagraphs (const char *str, lpsm_Format format) |
| Count the number of paragraphs or elements in a string. | |
| char * | lpsm_ConvertFormat (const char *str, lpsm_Format format1, lpsm_Format format2) |
| Convert a string between two formats. | |
| void | lpsm_DeleteString (char *str) |
| Delete a string returned by a function. | |
Contains the definitions of all the C wrapper's functions.
This file defines all the functions declared in lipsum.h. This file is under the BSD Zero-Clause License.
| #define LPSM_CPPIFY | ( | x, | |
| type ) |
| char * lpsm_ConvertFormat | ( | const char * | str, |
| lpsm_Format | format1, | ||
| lpsm_Format | format2 ) |
Convert a string between two formats.
Attempt a conversion of a string between the two specified formats.
| str | The string inputted. |
| format1 | The string's format. |
| format2 | The destination format. |
| int lpsm_CountParagraphs | ( | const char * | str, |
| lpsm_Format | format ) |
Count the number of paragraphs or elements in a string.
Count the number of tab characters in a non-formatted string, double newlines in Markdown/HTML strings, and elements in HTML strings.
| str | The string inputted. |
| format | The format the string is in. |
| int lpsm_CountSentenceFragments | ( | const char * | str | ) |
Count the number of sentence fragments in a string.
Count the number of commas, semicolons, and hyphens in a string, excluding usage in Markdown. (i.e. hyphen at start of line, or in parentheses)
| str | The string inputted. |
| int lpsm_CountSentences | ( | const char * | str | ) |
Count the number of sentences in a string.
Count the number of periods in a string, ignoring usage in Markdown URLs.
| str | The string inputted. |
| int lpsm_CountWords | ( | const char * | str | ) |
Count the number of words in a string.
Count the number of words in a string using a naive approach. It counts some Markdown formatting as words.
| str | The string inputted. |
| void lpsm_DeleteString | ( | char * | str | ) |
Delete a string returned by a function.
Since pointers allocated with new[] cannot be deallocated with free(), this function handles the deallocation.
| str | The string to delete. |
| char * lpsm_GenerateDefaultLipsumSentence | ( | void | ) |
Generate the beginning Lorem Ipsum sentence.
Returns the sentence "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
| const char * lpsm_internal_Version__ | ( | ) |
Return the current version of lipsum-cpp.
Return the current version of lipsum-cpp, intended for wrappers.