summaryrefslogtreecommitdiff
path: root/docs/gsg/CXX/coreindexusage.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gsg/CXX/coreindexusage.html')
-rw-r--r--docs/gsg/CXX/coreindexusage.html18
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-&gt;set_data(itemname);
- skey-&gt;set_size(strlen(itemname) + 1);
+ skey-&gt;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 &amp;e) {
std::cerr &lt;&lt; "Error loading databases. " &lt;&lt; std::endl;
std::cerr &lt;&lt; e.what() &lt;&lt; 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 &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;cstdlib&gt;
@@ -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 &amp;itemnameSDB, MyDb &amp;vendorDB, std::string &amp;itemName)
// Get the search key. This is the name on the inventory
// record that we want to examine.
std::cout &lt;&lt; "Looking for " &lt;&lt; itemName &lt;&lt; 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