The Battle for Wesnoth
1.15.9+dev
server
common
resultsets
tournaments.cpp
Go to the documentation of this file.
1
/*
2
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY.
10
11
See the COPYING file for more details.
12
*/
13
14
#ifdef HAVE_MYSQLPP
15
16
#include "
server/common/resultsets/tournaments.hpp
"
17
18
void
tournaments::read
(mariadb::result_set_ref rslt)
19
{
20
while
(rslt->next())
21
{
22
rows
.push_back(data{ rslt->get_string(
"TITLE"
), rslt->get_string(
"STATUS"
), rslt->get_string(
"URL"
) });
23
}
24
}
25
26
std::string
tournaments::str
()
27
{
28
std::string text;
29
for
(
const
auto
& row :
rows
)
30
{
31
text +=
"\nThe tournament "
+row.title+
" is "
+row.status+
". More information can be found at "
+row.url;
32
}
33
return
text;
34
}
35
36
#endif //HAVE_MYSQLPP
tournaments.hpp
tournaments::str
std::string str()
tournaments::read
void read(mariadb::result_set_ref rslt)
tournaments::rows
std::vector< data > rows
Definition:
tournaments.hpp:36
Generated by
1.8.13