| 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_byteswapped()</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_bt_minkey.html" title="Db::get_bt_minkey()" /> |
| 12 | <link rel="next" href="dbget_cachesize.html" title="Db::get_cachesize()" /> |
| 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_byteswapped()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbget_bt_minkey.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="dbget_cachesize.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_byteswapped"></a>Db::get_byteswapped()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | Db::get_byteswapped(int *isswapped);</pre> |
| 45 | <p> |
| 46 | The <code class="methodname">Db::get_byteswapped()</code> method returns |
| 47 | whether the underlying database |
| 48 | files were created on an architecture of the same byte order as the |
| 49 | current one, or if they were not (that is, big-endian on a |
| 50 | little-endian machine, or vice versa). This information may be used to |
| 51 | determine whether application data needs to be adjusted for this |
| 52 | architecture or not. |
| 53 | </p> |
| 54 | <p> |
| 55 | The <code class="methodname">Db::get_byteswapped()</code> method may not be called before the |
| 56 | <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called. |
| 57 | </p> |
| 58 | <p> |
| 59 | The <code class="methodname">Db::get_byteswapped()</code> <span> |
| 60 | |
| 61 | <span> |
| 62 | method either returns a non-zero error value or throws an |
| 63 | exception that encapsulates a non-zero error value on |
| 64 | failure, and returns 0 on success. |
| 65 | </span> |
| 66 | </span> |
| 67 | </p> |
| 68 | <div class="sect2" lang="en" xml:lang="en"> |
| 69 | <div class="titlepage"> |
| 70 | <div> |
| 71 | <div> |
| 72 | <h3 class="title"><a id="idp1720704"></a>Parameters</h3> |
| 73 | </div> |
| 74 | </div> |
| 75 | </div> |
| 76 | <div class="sect3" lang="en" xml:lang="en"> |
| 77 | <div class="titlepage"> |
| 78 | <div> |
| 79 | <div> |
| 80 | <h4 class="title"><a id="idm496568"></a>isswapped</h4> |
| 81 | </div> |
| 82 | </div> |
| 83 | </div> |
| 84 | <p> |
| 85 | If the underlying database files were created on an architecture of |
| 86 | the same byte order as the current one, 0 is stored into the memory |
| 87 | location referenced by <span class="bold"><strong>isswapped</strong></span>. If |
| 88 | the underlying database files were created on an architecture of a |
| 89 | different byte order as the current one, 1 is stored into the memory |
| 90 | location referenced by <span class="bold"><strong>isswapped</strong></span>. |
| 91 | </p> |
| 92 | </div> |
| 93 | </div> |
| 94 | <div class="sect2" lang="en" xml:lang="en"> |
| 95 | <div class="titlepage"> |
| 96 | <div> |
| 97 | <div> |
| 98 | <h3 class="title"><a id="idp2679216"></a>Errors</h3> |
| 99 | </div> |
| 100 | </div> |
| 101 | </div> |
| 102 | <p> |
| 103 | The <code class="methodname">Db::get_byteswapped()</code> <span> |
| 104 | |
| 105 | <span> |
| 106 | method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 107 | exception, encapsulating one of the following non-zero errors, or return one |
| 108 | of the following non-zero errors: |
| 109 | </span> |
| 110 | </span> |
| 111 | </p> |
| 112 | <div class="sect3" lang="en" xml:lang="en"> |
| 113 | <div class="titlepage"> |
| 114 | <div> |
| 115 | <div> |
| 116 | <h4 class="title"><a id="idp971248"></a>EINVAL</h4> |
| 117 | </div> |
| 118 | </div> |
| 119 | </div> |
| 120 | <p> |
| 121 | If the method was called before <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> |
| 122 | was called; or if an invalid flag value or parameter was specified. |
| 123 | </p> |
| 124 | </div> |
| 125 | </div> |
| 126 | <div class="sect2" lang="en" xml:lang="en"> |
| 127 | <div class="titlepage"> |
| 128 | <div> |
| 129 | <div> |
| 130 | <h3 class="title"><a id="idm1903800"></a>Class</h3> |
| 131 | </div> |
| 132 | </div> |
| 133 | </div> |
| 134 | <p> |
| 135 | <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> |
| 136 | </p> |
| 137 | </div> |
| 138 | <div class="sect2" lang="en" xml:lang="en"> |
| 139 | <div class="titlepage"> |
| 140 | <div> |
| 141 | <div> |
| 142 | <h3 class="title"><a id="idm355752"></a>See Also</h3> |
| 143 | </div> |
| 144 | </div> |
| 145 | </div> |
| 146 | <p> |
| 147 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 148 | </p> |
| 149 | </div> |
| 150 | </div> |
| 151 | <div class="navfooter"> |
| 152 | <hr /> |
| 153 | <table width="100%" summary="Navigation footer"> |
| 154 | <tr> |
| 155 | <td width="40%" align="left"><a accesskey="p" href="dbget_bt_minkey.html">Prev</a> </td> |
| 156 | <td width="20%" align="center"> |
| 157 | <a accesskey="u" href="db.html">Up</a> |
| 158 | </td> |
| 159 | <td width="40%" align="right"> <a accesskey="n" href="dbget_cachesize.html">Next</a></td> |
| 160 | </tr> |
| 161 | <tr> |
| 162 | <td width="40%" align="left" valign="top">Db::get_bt_minkey() </td> |
| 163 | <td width="20%" align="center"> |
| 164 | <a accesskey="h" href="index.html">Home</a> |
| 165 | </td> |
| 166 | <td width="40%" align="right" valign="top"> Db::get_cachesize()</td> |
| 167 | </tr> |
| 168 | </table> |
| 169 | </div> |
| 170 | </body> |
| 171 | </html> |