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::set_lorder()</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="dbset_h_nelem.html" title="Db::set_h_nelem()" /> 12 <link rel="next" href="dbset_message_stream.html" title="Db::set_message_stream()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Db::set_lorder()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_h_nelem.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��2.�� 23 The Db Handle 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="dbset_message_stream.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbset_lorder"></a>Db::set_lorder()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41Db::set_lorder(int lorder); </pre> 42 <p> 43 Set the byte order for integers in the stored database metadata. The 44 host byte order of the machine where the Berkeley DB library was 45 compiled will be used if no byte order is set. 46 </p> 47 <p> 48 <span class="bold"><strong>The access methods provide no guarantees about 49 the byte ordering of the application data stored in the database, and 50 applications are responsible for maintaining any necessary 51 ordering.</strong></span> 52 </p> 53 <p> 54 The <code class="methodname">Db::set_lorder()</code> method configures a database, not only 55 operations performed using the specified <a class="link" href="db.html" title="Chapter��2.�� The Db Handle">Db</a> 56 handle. 57 </p> 58 <p> 59 The <code class="methodname">Db::set_lorder()</code> method may not be called after the 60 <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called. If 61 the database already exists when <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 62 is called, the information specified to <code class="methodname">Db::set_lorder()</code> will be ignored. 63 </p> 64 <p> 65 66 If creating additional databases in a single physical file, 67 information specified to 68 <code class="methodname">Db::set_lorder()</code> will be ignored and the 69 byte order of the existing databases will be used. 70 71 </p> 72 <p> 73 The <code class="methodname">Db::set_lorder()</code> <span> 74 75 <span> 76 method either returns a non-zero error value or throws an 77 exception that encapsulates a non-zero error value on 78 failure, and returns 0 on success. 79 </span> 80 </span> 81 </p> 82 <div class="sect2" lang="en" xml:lang="en"> 83 <div class="titlepage"> 84 <div> 85 <div> 86 <h3 class="title"><a id="id1648809"></a>Parameters</h3> 87 </div> 88 </div> 89 </div> 90 <div class="sect3" lang="en" xml:lang="en"> 91 <div class="titlepage"> 92 <div> 93 <div> 94 <h4 class="title"><a id="id1648792"></a>lorder</h4> 95 </div> 96 </div> 97 </div> 98 <p> 99 The <span class="bold"><strong>lorder</strong></span> parameter should represent 100 the byte order as an integer; for example, big endian order is the 101 number 4,321, and little endian order is the number 1,234. 102 </p> 103 </div> 104 </div> 105 <div class="sect2" lang="en" xml:lang="en"> 106 <div class="titlepage"> 107 <div> 108 <div> 109 <h3 class="title"><a id="id1648872"></a>Errors</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 The <code class="methodname">Db::set_lorder()</code> <span> 115 116 <span> 117 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter��6.��The DbException Class">DbException</a> 118 exception, encapsulating one of the following non-zero errors, or return one 119 of the following non-zero errors: 120 </span> 121 </span> 122 </p> 123 <div class="sect3" lang="en" xml:lang="en"> 124 <div class="titlepage"> 125 <div> 126 <div> 127 <h4 class="title"><a id="id1648931"></a>EINVAL</h4> 128 </div> 129 </div> 130 </div> 131 <p> 132 If the method was called after <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 133 was called; or if an invalid flag value or parameter was specified. 134 </p> 135 </div> 136 </div> 137 <div class="sect2" lang="en" xml:lang="en"> 138 <div class="titlepage"> 139 <div> 140 <div> 141 <h3 class="title"><a id="id1648208"></a>Class</h3> 142 </div> 143 </div> 144 </div> 145 <p> 146 <a class="link" href="db.html" title="Chapter��2.�� The Db Handle">Db</a> 147 </p> 148 </div> 149 <div class="sect2" lang="en" xml:lang="en"> 150 <div class="titlepage"> 151 <div> 152 <div> 153 <h3 class="title"><a id="id1648788"></a>See Also</h3> 154 </div> 155 </div> 156 </div> 157 <p> 158 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 159 </p> 160 </div> 161 </div> 162 <div class="navfooter"> 163 <hr /> 164 <table width="100%" summary="Navigation footer"> 165 <tr> 166 <td width="40%" align="left"><a accesskey="p" href="dbset_h_nelem.html">Prev</a>��</td> 167 <td width="20%" align="center"> 168 <a accesskey="u" href="db.html">Up</a> 169 </td> 170 <td width="40%" align="right">��<a accesskey="n" href="dbset_message_stream.html">Next</a></td> 171 </tr> 172 <tr> 173 <td width="40%" align="left" valign="top">Db::set_h_nelem()��</td> 174 <td width="20%" align="center"> 175 <a accesskey="h" href="index.html">Home</a> 176 </td> 177 <td width="40%" align="right" valign="top">��Db::set_message_stream()</td> 178 </tr> 179 </table> 180 </div> 181 </body> 182</html> 183