diff options
Diffstat (limited to 'docs/gsg/CXX/coreindexusage.html')
-rw-r--r-- | docs/gsg/CXX/coreindexusage.html | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/gsg/CXX/coreindexusage.html b/docs/gsg/CXX/coreindexusage.html index fcfd0cbc..25f6d381 100644 --- a/docs/gsg/CXX/coreindexusage.html +++ b/docs/gsg/CXX/coreindexusage.html @@ -14,7 +14,7 @@ <body> <div xmlns="" class="navheader"> <div class="libver"> - <p>Library Version 11.2.5.3</p> + <p>Library Version 12.1.6.1</p> </div> <table width="100%" summary="Navigation header"> <tr> @@ -122,7 +122,7 @@ Remember that you can find the complete implementation of these functions in: </p> - <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples_cxx/getting_started</pre> + <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples/cxx/getting_started</pre> <p> where <code class="literal"><span class="emphasis"><em>DB_INSTALL</em></span></code> is the location where you placed your DB distribution. @@ -172,7 +172,7 @@ get_item_name(Db *dbp, const Dbt *pkey, const Dbt *pdata, Dbt *skey) // Now set the secondary key's data to be the item name skey->set_data(itemname); - skey->set_size(strlen(itemname) + 1); + skey->set_size((u_int32_t)strlen(itemname) + 1); return (0); }; </pre> @@ -314,11 +314,12 @@ main(int argc, char *argv[]) get_item_name, 0);</code></strong> + // Load the inventory database + loadInventoryDB(inventoryDB, inventoryFile); + // Load the vendor database loadVendorDB(vendorDB, vendorFile); - // Load the inventory database - loadInventoryDB(inventoryDB, inventoryFile); } catch(DbException &e) { std::cerr << "Error loading databases. " << std::endl; std::cerr << e.what() << std::endl; @@ -381,7 +382,7 @@ main(int argc, char *argv[]) and update our usage function slightly: </p> <a id="cxx_index14"></a> - <pre class="programlisting">// File: example_database_read.cpp + <pre class="programlisting">// File: excxx_example_database_read.cpp #include <iostream> #include <fstream> #include <cstdlib> @@ -470,7 +471,7 @@ main (int argc, char *argv[]) application in: </p> - <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples_cxx/getting_started</pre> + <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples/cxx/getting_started</pre> <p> where <code class="literal"><span class="emphasis"><em>DB_INSTALL</em></span></code> is the location where you placed your DB distribution. @@ -492,7 +493,8 @@ show_item(MyDb &itemnameSDB, MyDb &vendorDB, std::string &itemName) // Get the search key. This is the name on the inventory // record that we want to examine. std::cout << "Looking for " << itemName << std::endl; - Dbt key((void *)itemName.c_str(), itemName.length() + 1); + Dbt key((void *)itemName.c_str(), + (u_int32_t)itemName.length() + 1); Dbt data; // Position the cursor to the first record in the secondary |