DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

Db::get_byteswapped

API Ref

#include <db_cxx.h>

int Db::get_byteswapped(int *isswapped);


Description: Db::get_byteswapped

The Db::get_byteswapped method returns if the underlying database files were created on an architecture of the same byte order as the current one, or if they were not (that is, big-endian on a little-endian machine, or vice versa). This information may be used to determine whether application data needs to be adjusted for this architecture or not.

The Db::get_byteswapped method may not be called before the Db::open method has been called.

The Db::get_byteswapped 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

isswapped
If the underlying database files were created on an architecture of the same byte order as the current one. 0 is stored into the memory location referenced by isswapped. If the underlying database files were created on an architecture of a different byte order as the current one, 1 is stored into the memory location referenced by isswapped.

Errors

The Db::get_byteswapped 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 before Db::open was called; or if an invalid flag value or parameter was specified.

Class

Db

See Also

Databases and Related Methods

APIRef

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