mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-26 08:28:29 -04:00
* EGD-3229 text helper classes added with tests - used in tests, plus misc utils needed No major actual functionality changed - TextClasses added with this PR are used in tests only in this commit. * classes needed to rewrite gui::Text added * some utilities needed to rewrite gui::Text added * tests added
17 lines
431 B
C++
17 lines
431 B
C++
#include "TextParse.hpp"
|
|
#include <sstream>
|
|
|
|
namespace gui
|
|
{
|
|
auto textToTextBlocks(const UTF8 &text, Font *font, TextBlock::End end) -> std::list<TextBlock>
|
|
{
|
|
std::list<TextBlock> lines;
|
|
std::stringstream ss(text.c_str());
|
|
std::string line;
|
|
while (std::getline(ss, line)) {
|
|
lines.emplace_back(TextBlock(line, font, end));
|
|
}
|
|
return lines;
|
|
}
|
|
} // namespace gui
|