Label.cc
702 Bytes
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
/*
* Label.cc
*
* Created on: 27 nov. 2013
* Author: CS
*/
#include "Label.hh"
#include <sstream>
#include <algorithm>
#include <boost/regex.hpp>
#include <boost/algorithm/string/regex.hpp>
namespace plot {
const std::string Label::DELIMITER = "/breakline/";
LabelRowInfo Label::getRowNumber(Label const& pLegend) {
LabelRowInfo lSplittedLegend;
if (!pLegend._text.empty()) {
boost::split_regex(lSplittedLegend, pLegend._text,
boost::regex(Label::DELIMITER));
}
return lSplittedLegend;
}
void Label::dump(std::ostream& out, std::string& prefix) {
prefix += "label.";
out << prefix << "text=" << _text;
out << prefix << "color=" << _color;
_font.dump(out, prefix);
}
}