Label.cc 702 Bytes
/*
 * 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);
}

}