lipsum-cpp 0.5.4
A basic library written in C++ for generating placeholder Lorem Ipsum text.
Loading...
Searching...
No Matches
source.hpp
Go to the documentation of this file.
1
12#pragma once
13
14#include "core.hpp"
15
16namespace lipsum
17{
27 {
28 public:
37 Source() = default;
38
50 Source(const std::string& path);
51
65 void load([[maybe_unused]] const std::string& path);
66
82 [[nodiscard]] std::string random_word(std::mt19937& gen,
83 bool lazy = false);
84
85 private:
86 int idx = -1;
87 std::string currentLoaded;
89 std::vector<std::string>
91 };
92} // namespace lipsum
Source()=default
Default constructor.
std::string currentLoaded
Definition source.hpp:87
std::string random_word(std::mt19937 &gen, bool lazy=false)
Select a random word.
Definition source.inl:40
std::vector< std::string > m_Words
The internal list of words stored.
Definition source.hpp:90
void load(const std::string &path)
Load a source and fill the vector.
Definition source.inl:57
Core macros for lipsum-cpp.
#define LIPSUM_API
Macro for shared libraries.
Definition core.hpp:71
This is the main namespace of lipsum-cpp.