Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[patch] examples updated to use row[0]: msg#00068

db.mysql.c++

Subject: [patch] examples updated to use row[0]

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>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation