82 template <
typename T,
typename ... _Args>
83 static auto toTH(
const T &val,
const _Args& ... args) -> std::string
87 size_t size =
sizeof...(args)+1;
89 fetchTX(
"th", str, i, size, val, args...);
93 static auto toTH(
const T &val) -> std::string
97 "\t\t" + toTD(val) +
"\n" +
135 template <
typename T,
typename ... _Args>
136 static auto toTR(
const T &val,
const _Args& ... args) -> std::string
140 size_t size =
sizeof...(args)+1;
142 fetchTX(
"tr", str, i, size, val, args...);
145 template <
typename T>
146 static auto toTR(
const T &val) -> std::string
150 "\t\t" + toTD(val) +
"\n" +
161 virtual auto toHTML()
const->std::string = 0;
164 template <
typename T,
typename ... _Args>
165 static void fetchTX(
const std::string &tag, std::string &str,
size_t &index,
size_t size,
const T &val,
const _Args& ... args)
167 fetchTX(tag, str, index, size, val);
170 fetchTX(tag, str, index, size, args...);
172 template <
typename T>
173 static void fetchTX(
const std::string &tag, std::string &str,
size_t &index,
size_t size,
const T &val)
176 str +=
"\t<" + tag +
">\n";
178 str +=
"\t\t" + toTD(val) +
"\n";
180 if (index == size - 1)
181 str +=
"\t</" + tag +
">";
184 template <
typename T>
185 static auto toTD(
const T &val) -> std::string
187 std::stringstream ss;
189 ss <<
"<td>" << val <<
"</td>";
192 template<>
static auto toTD(
const WeakString &)->std::string;
static auto toTR(const T &val, const _Args &...args) -> std::string
Get a string represents a <tr> tag.
static auto toTH(const T &val, const _Args &...args) -> std::string
Get a string represents a <th> tag.
virtual auto toHTML() const -> std::string=0
Get an html string represents the Entity.
An interface supporting conversion to html.
A string class only references characeters, reference only.