-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathRenderTextProcessor.cpp
More file actions
40 lines (31 loc) · 1.06 KB
/
Copy pathRenderTextProcessor.cpp
File metadata and controls
40 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ===========================================================================
// RenderTextProcessor.cpp
// ===========================================================================
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include "RenderListStrategy.h"
#include "RenderMarkdownListStrategy.h"
#include "RenderHtmlListStrategy.h"
#include "RenderTextProcessor.h"
void RenderTextProcessor::setOutputFormat(std::unique_ptr<RenderListStrategy>&& format) {
m_format = std::move(format);
}
void RenderTextProcessor::appendList(const std::vector<std::string>& items) {
m_format->start(m_oss);
for (const auto& item : items)
m_format->add(m_oss, item);
m_format->end(m_oss);
}
std::string RenderTextProcessor::toString() const {
return m_oss.str();
}
void RenderTextProcessor::clear() {
m_oss.str("");
m_oss.clear();
}
// ===========================================================================
// End-of-File
// ===========================================================================