lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
Loading...
Searching...
No Matches
misc.hpp
Go to the documentation of this file.
1
14#pragma once
15
16#include "core/argvec2.hpp"
17#include "core/core.hpp"
18#include "core/source.hpp"
19
20namespace lipsum
21{
32 enum class Format : int
33 {
34 Plain = 0,
35 Markdown,
36 HTML,
37 JSON,
38 XML
39 };
40
41 /*
42 * MISC
43 * ----------------
44 */
45
57
70 LIPSUM_API int CountWords(const std::string& str);
71
85 LIPSUM_API int CountSentenceFragments(const std::string& str);
86
99 LIPSUM_API int CountSentences(const std::string& str);
100
114 LIPSUM_API int CountParagraphs(const std::string& str,
115 Format format = Format::Plain);
116
117 // TODO: Doxygen comment, C binding, more conversion routes
131 LIPSUM_API std::string ConvertFormat(const std::string& str,
132 Format format1 = Format::Plain,
133 Format format2 = Format::HTML);
134
135} // namespace lipsum
Declaration of lipsum::ArgVec2.
Core macros for lipsum-cpp.
#define LIPSUM_API
Macro for shared libraries.
Definition core.hpp:71
This is the main namespace of lipsum-cpp.
LIPSUM_API int CountSentences(const std::string &str)
Count the number of sentences in a string.
Definition misc.inl:127
LIPSUM_API int CountSentenceFragments(const std::string &str)
Count the number of sentence fragments in a string.
Definition misc.inl:88
LIPSUM_API int CountWords(const std::string &str)
Count the number of words in a string.
Definition misc.inl:43
LIPSUM_API std::string ConvertFormat(const std::string &str, Format format1=Format::Plain, Format format2=Format::HTML)
Convert a string between two formats.
Definition misc.inl:190
Format
Types of formats.
Definition misc.hpp:33
LIPSUM_API int CountParagraphs(const std::string &str, Format format=Format::Plain)
Count the number of paragraphs or elements in a string.
Definition misc.inl:151
LIPSUM_API std::string GenerateDefaultLipsumSentence()
Generate the beginning Lorem Ipsum sentence.
Definition misc.inl:38
Mutli-source generation for lipsum-cpp.