Db::set_lorder

API Ref

#include <db_cxx.h>

int Db::set_lorder(int lorder);

int Db::get_lorder(int *lorderp);


Description: Db::set_lorder

Set the byte order for integers in the stored database metadata. The host byte order of the machine where the Berkeley DB library was compiled will be used if no byte order is set.

The access methods provide no guarantees about the byte ordering of the application data stored in the database, and applications are responsible for maintaining any necessary ordering.

The Db::set_lorder method configures a database, not only operations performed using the specified Db handle.

The Db::set_lorder method may not be called after the Db::open method is called. If the database already exists when Db::open is called, the information specified to Db::set_lorder will be ignored.

If creating additional databases in a single physical file, information specified to Db::set_lorder will be ignored and the byte order of the existing databases will be used.

The Db::set_lorder method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

lorder
The lorder parameter should represent the byte order as an integer; for example, big endian order is the number 4,321, and little endian order is the number 1,234.

Errors

The Db::set_lorder method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

EINVAL
If the method was called after Db::open was called; or if an invalid flag value or parameter was specified.

Description: Db::get_lorder

The Db::get_lorder method returns the database byte order; a byte order of 4,321 indicates a big endian order, and a byte order of 1,234 indicates a little endian order.

The Db::get_lorder method may be called at any time during the life of the application.

The Db::get_lorder method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

lorderp
The Db::get_lorder method returns the database byte order in lorderp.

Class

Db

See Also

Databases and Related Methods

APIRef

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.