dbTalk Databases Forums  

[patch] examples updated to use row[0]

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss [patch] examples updated to use row[0] in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Frey
 
Posts: n/a

Default [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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.