|
|
Choosing A Webhost: |
[patch] examples updated to use row[0]: msg#00068db.mysql.c++
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?unsub=gcdmc-plusplus@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [patch] row::operator[] - template version, Chris Frey |
|---|---|
| Next by Date: | Re: [patch] row::operator[](int), Chris Frey |
| Previous by Thread: | [patch] row::operator[] - template version, Chris Frey |
| Next by Thread: | test, please ignore, Chris Frey |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |