| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>Db::get_type()</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> |
| 10 | <link rel="up" href="db.html" title="Chapter 2. The Db Handle" /> |
| 11 | <link rel="prev" href="dbget_re_source.html" title="Db::get_re_source()" /> |
| 12 | <link rel="next" href="dbjoin.html" title="Db::join()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">Db::get_type()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbget_re_source.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 2. |
| 26 | The Db Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="dbjoin.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="dbget_type"></a>Db::get_type()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | Db::get_type(DBTYPE *type);</pre> |
| 45 | <p> |
| 46 | The <code class="methodname">Db::get_type()</code> method returns the type of the underlying access |
| 47 | method (and file format). The type value is one of DB_BTREE, DB_HASH, |
| 48 | DB_RECNO, or DB_QUEUE. This value may be used to determine the type |
| 49 | of the database after a return from <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> |
| 50 | with the <span class="bold"><strong>type</strong></span> parameter set to DB_UNKNOWN. |
| 51 | </p> |
| 52 | <p> |
| 53 | The <code class="methodname">Db::get_type()</code> method may not be called before the |
| 54 | <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called. |
| 55 | </p> |
| 56 | <p> |
| 57 | The <code class="methodname">Db::get_type()</code> <span> |
| 58 | |
| 59 | <span> |
| 60 | method either returns a non-zero error value or throws an |
| 61 | exception that encapsulates a non-zero error value on |
| 62 | failure, and returns 0 on success. |
| 63 | </span> |
| 64 | </span> |
| 65 | </p> |
| 66 | <div class="sect2" lang="en" xml:lang="en"> |
| 67 | <div class="titlepage"> |
| 68 | <div> |
| 69 | <div> |
| 70 | <h3 class="title"><a id="idm989024"></a>Parameters</h3> |
| 71 | </div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="sect3" lang="en" xml:lang="en"> |
| 75 | <div class="titlepage"> |
| 76 | <div> |
| 77 | <div> |
| 78 | <h4 class="title"><a id="idp4648968"></a>type</h4> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |
| 82 | <p> |
| 83 | The <span class="bold"><strong>type</strong></span> parameter references memory |
| 84 | into which the type of the underlying access method is copied. |
| 85 | </p> |
| 86 | </div> |
| 87 | </div> |
| 88 | <div class="sect2" lang="en" xml:lang="en"> |
| 89 | <div class="titlepage"> |
| 90 | <div> |
| 91 | <div> |
| 92 | <h3 class="title"><a id="idp2586608"></a>Errors</h3> |
| 93 | </div> |
| 94 | </div> |
| 95 | </div> |
| 96 | <p> |
| 97 | The <code class="methodname">Db::get_type()</code> <span> |
| 98 | |
| 99 | <span> |
| 100 | method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 101 | exception, encapsulating one of the following non-zero errors, or return one |
| 102 | of the following non-zero errors: |
| 103 | </span> |
| 104 | </span> |
| 105 | </p> |
| 106 | <div class="sect3" lang="en" xml:lang="en"> |
| 107 | <div class="titlepage"> |
| 108 | <div> |
| 109 | <div> |
| 110 | <h4 class="title"><a id="idm753232"></a>EINVAL</h4> |
| 111 | </div> |
| 112 | </div> |
| 113 | </div> |
| 114 | <p> |
| 115 | If the method was called before <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> |
| 116 | was called; or if an invalid flag value or parameter was specified. |
| 117 | </p> |
| 118 | </div> |
| 119 | </div> |
| 120 | <div class="sect2" lang="en" xml:lang="en"> |
| 121 | <div class="titlepage"> |
| 122 | <div> |
| 123 | <div> |
| 124 | <h3 class="title"><a id="idp4103264"></a>Class</h3> |
| 125 | </div> |
| 126 | </div> |
| 127 | </div> |
| 128 | <p> |
| 129 | <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> |
| 130 | </p> |
| 131 | </div> |
| 132 | <div class="sect2" lang="en" xml:lang="en"> |
| 133 | <div class="titlepage"> |
| 134 | <div> |
| 135 | <div> |
| 136 | <h3 class="title"><a id="idp1699640"></a>See Also</h3> |
| 137 | </div> |
| 138 | </div> |
| 139 | </div> |
| 140 | <p> |
| 141 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 142 | </p> |
| 143 | </div> |
| 144 | </div> |
| 145 | <div class="navfooter"> |
| 146 | <hr /> |
| 147 | <table width="100%" summary="Navigation footer"> |
| 148 | <tr> |
| 149 | <td width="40%" align="left"><a accesskey="p" href="dbget_re_source.html">Prev</a> </td> |
| 150 | <td width="20%" align="center"> |
| 151 | <a accesskey="u" href="db.html">Up</a> |
| 152 | </td> |
| 153 | <td width="40%" align="right"> <a accesskey="n" href="dbjoin.html">Next</a></td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td width="40%" align="left" valign="top">Db::get_re_source() </td> |
| 157 | <td width="20%" align="center"> |
| 158 | <a accesskey="h" href="index.html">Home</a> |
| 159 | </td> |
| 160 | <td width="40%" align="right" valign="top"> Db::join()</td> |
| 161 | </tr> |
| 162 | </table> |
| 163 | </div> |
| 164 | </body> |
| 165 | </html> |