|
lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
|
C wrapper over lipsum-cpp. More...
Go to the source code of this file.
Typedefs | |
| typedef enum lpsm_Format | lpsm_Format |
| Types of formats. | |
Enumerations | |
| enum | lpsm_Format { LPSM_FMT_PLAIN = 0 , LPSM_FMT_MARKDOWN , LPSM_FMT_HTML , LPSM_FMT_JSON , LPSM_FMT_XML } |
| Types of formats. More... | |
Functions | |
| LIPSUMC_API char * | lpsm_GenerateDefaultLipsumSentence (void) |
| Generate the beginning Lorem Ipsum sentence. | |
| LIPSUMC_API const char * | lpsm_internal_Version__ () |
| Return the current version of lipsum-cpp. | |
| LIPSUMC_API int | lpsm_CountWords (const char *str) |
| Count the number of words in a string. | |
| LIPSUMC_API int | lpsm_CountSentenceFragments (const char *str) |
| Count the number of sentence fragments in a string. | |
| LIPSUMC_API int | lpsm_CountSentences (const char *str) |
| Count the number of sentences in a string. | |
| LIPSUMC_API int | lpsm_CountParagraphs (const char *str, lpsm_Format format) |
| Count the number of paragraphs or elements in a string. | |
| LIPSUMC_API char * | lpsm_ConvertFormat (const char *str, lpsm_Format format1, lpsm_Format format2) |
| Convert a string between two formats. | |
| LIPSUMC_API void | lpsm_DeleteString (char *str) |
| Delete a string returned by a function. | |
C wrapper over lipsum-cpp.
This contains the C wrapper over lipsum-cpp. It requires being built as a static or shared library in order to function. This file is under the BSD Zero-Clause License.
| typedef enum lpsm_Format lpsm_Format |
Types of formats.
Types of formats used in lpsm_CountParagraphs() and lpsm_ConvertFormat(). In lpsm_CountParagraphs(), LPSM_FMT_PLAIN is counting plain text, LPSM_FMT_MARKDOWN is counting Markdown or HTML, and LPSM_FMT_HTML is counting HTML explicitly. Formerly known as lpsm_CountParaMethod.
| enum lpsm_Format |
Types of formats.
Types of formats used in lpsm_CountParagraphs() and lpsm_ConvertFormat(). In lpsm_CountParagraphs(), LPSM_FMT_PLAIN is counting plain text, LPSM_FMT_MARKDOWN is counting Markdown or HTML, and LPSM_FMT_HTML is counting HTML explicitly. Formerly known as lpsm_CountParaMethod.
| LIPSUMC_API 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. |
| LIPSUMC_API 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. |
| LIPSUMC_API 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. |
| LIPSUMC_API 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. |
| LIPSUMC_API 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. |
| LIPSUMC_API 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. |
| LIPSUMC_API char * lpsm_GenerateDefaultLipsumSentence | ( | void | ) |
Generate the beginning Lorem Ipsum sentence.
Returns the sentence "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
| LIPSUMC_API const char * lpsm_internal_Version__ | ( | ) |
Return the current version of lipsum-cpp.
Return the current version of lipsum-cpp, intended for wrappers.