[patch] examples updated to use row[0] -
09-17-2005
, 08:13 PM
Here's the patch to update the examples for testing.
- Chris
Index: examples/dbinfo.cpp
================================================== =================
--- examples/dbinfo.cpp (revision 1119)
+++ examples/dbinfo.cpp (working copy)
@@ -69,7 +69,7 @@
Result::iterator i;
for (i = res.begin(); i != res.end(); ++i) {
row = *i;
- cout << endl << '\t' << setw(17) << row.at(0);
+ cout << endl << '\t' << setw(17) << row[0];
}
cout << separator;
@@ -86,8 +86,8 @@
cout.setf(ios::left);
for (i = res.begin(); i != res.end(); ++i) {
row = *i;
- string xx(row.at(0));
- cout << endl << '\t' << setw(17) << row.at(0);
+ string xx(row[0]);
+ cout << endl << '\t' << setw(17) << row[0];
yy.push_back(xx);
}
cout << separator;
Index: examples/updel.cpp
================================================== =================
--- examples/updel.cpp (revision 1119)
+++ examples/updel.cpp (working copy)
@@ -56,7 +56,7 @@
" in (";
// for UPDATE just replace the above DELETE FROM with UPDATE statement
for (; row = res.fetch_row(); i++)
- strbuf << row.at(0) << ",";
+ strbuf << row[0] << ",";
if (!i)
return 0;
string output(strbuf.str());
Index: examples/simple1.cpp
================================================== =================
--- examples/simple1.cpp (revision 1119)
+++ examples/simple1.cpp (working copy)
@@ -55,7 +55,7 @@
mysqlpp::Row row;
mysqlpp::Row::size_type i;
for (i = 0; row = res.at(i); ++i) {
- cout << '\t' << utf8trans(row.at(0), buf, sizeof(buf)) << endl;
+ cout << '\t' << utf8trans(row[0], buf, sizeof(buf)) << endl;
}
}
else {
Index: examples/util.cpp
================================================== =================
--- examples/util.cpp (revision 1119)
+++ examples/util.cpp (working copy)
@@ -150,7 +150,7 @@
// ColData object, which is dead by the time the pointer is
// evaluated in print_stock_row(). It will probably even work this
// way, but like any memory bug, it can wreak subtle havoc.
- std::string item(row.at(0));
+ std::string item(row[0]);
print_stock_row(item, row["num"], row[2], row[3], row[4]);
}
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw |