Btrieve 2
Loading...
Searching...
No Matches
BtrieveClient Class Reference

The Btrieve client class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveClient ()
 
 BtrieveClient (int serviceAgentIdentifier, int clientIdentifier)
 
 ~BtrieveClient ()
 
Btrieve::StatusCode CollectionClose (BtrieveCollection *btrieveCollection)
 Close a collection.
 
Btrieve::StatusCode CollectionCreate (const char *collectionName)
 Create a collection.
 
Btrieve::StatusCode CollectionDelete (const char *collectionName)
 Delete a collection.
 
Btrieve::StatusCode CollectionOpen (BtrieveCollection *btrieveCollection, const char *collectionName, const char *password=NULL)
 Open a collection.
 
Btrieve::StatusCode CollectionRename (const char *existingCollectionName, const char *newCollectionName)
 Rename a collection.
 
Btrieve::StatusCode ContinuousOperationBegin (const char *pathNames)
 Begin continuous operation.
 
Btrieve::StatusCode ContinuousOperationBegin (const wchar_t *pathNames)
 Begin continuous operation.
 
Btrieve::StatusCode ContinuousOperationEnd (const char *pathNames)
 End continuous operation.
 
Btrieve::StatusCode ContinuousOperationEnd (const wchar_t *pathNames)
 End continuous operation.
 
Btrieve::StatusCode FileClose (BtrieveFile *btrieveFile)
 Close a file.
 
Btrieve::StatusCode FileCreate (BtrieveFileAttributes *btrieveFileAttributes, BtrieveIndexAttributes *btrieveIndexAttributes, const char *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Create a file.
 
Btrieve::StatusCode FileCreate (BtrieveFileAttributes *btrieveFileAttributes, BtrieveIndexAttributes *btrieveIndexAttributes, const wchar_t *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Create a file.
 
Btrieve::StatusCode FileCreate (BtrieveFileAttributes *btrieveFileAttributes, const char *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Create a file.
 
Btrieve::StatusCode FileCreate (BtrieveFileAttributes *btrieveFileAttributes, const wchar_t *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Create a file.
 
Btrieve::StatusCode FileDelete (const char *fileName)
 Delete a file.
 
Btrieve::StatusCode FileDelete (const wchar_t *fileName)
 Delete a file.
 
Btrieve::StatusCode FileOpen (BtrieveFile *btrieveFile, const char *fileName, const char *ownerName, Btrieve::OpenMode openMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Open a file.
 
Btrieve::StatusCode FileOpen (BtrieveFile *btrieveFile, const wchar_t *fileName, const char *ownerName, Btrieve::OpenMode openMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
 Open a file.
 
Btrieve::StatusCode FileRename (const char *existingFileName, const char *newFileName)
 Rename a file.
 
Btrieve::StatusCode FileRename (const wchar_t *existingFileName, const wchar_t *newFileName)
 Rename a file.
 
int GetClientIdentifier ()
 Get the client identifier.
 
const char * GetCurrentDirectory (Btrieve::DiskDrive diskDrive)
 Get the current directory.
 
Btrieve::StatusCode GetCurrentDirectory (Btrieve::DiskDrive diskDrive, char *currentDirectory, int currentDirectorySize)
 Get the current directory.
 
Btrieve::StatusCode GetCurrentDirectory (Btrieve::DiskDrive diskDrive, wchar_t *currentDirectory, int currentDirectorySize)
 Get the current directory.
 
Btrieve::StatusCode GetLastStatusCode ()
 Get the last status code.
 
int GetServiceAgentIdentifier ()
 Get the service agent identifier.
 
Btrieve::StatusCode GetVersion (BtrieveVersion *btrieveVersion, BtrieveFile *btrieveFile=NULL)
 Get the version.
 
Btrieve::StatusCode Login (const char *databaseURI)
 Login.
 
Btrieve::StatusCode Login (const wchar_t *databaseURI)
 Login.
 
Btrieve::StatusCode Logout (const char *databaseURI)
 Logout.
 
Btrieve::StatusCode Logout (const wchar_t *databaseURI)
 Logout.
 
Btrieve::StatusCode Reset ()
 Reset.
 
Btrieve::StatusCode SetCurrentDirectory (const char *currentDirectory)
 Set the current directory.
 
Btrieve::StatusCode SetCurrentDirectory (const wchar_t *currentDirectory)
 Set the current directory.
 
Btrieve::StatusCode Stop ()
 Stop.
 
Btrieve::StatusCode TransactionAbort ()
 Abort a transaction.
 
Btrieve::StatusCode TransactionBegin (Btrieve::TransactionMode transactionMode, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE)
 Begin a transaction.
 
Btrieve::StatusCode TransactionEnd ()
 End a transaction.
 

Detailed Description

Constructor & Destructor Documentation

◆ BtrieveClient() [1/2]

BtrieveClient::BtrieveClient ( )
The service agent and client identifier will be automatically generated based on the caller's process and thread identifiers.

◆ BtrieveClient() [2/2]

BtrieveClient::BtrieveClient ( int serviceAgentIdentifier,
int clientIdentifier )
Parameters
[in]serviceAgentIdentifierThe service agent identifier. Use 0 to automatically generate a service agent identifier based on the caller's process identifier.
[in]clientIdentifierThe client identifier. Use 0 to automatically generate a client identifier based on the caller's thread identifier.
Snippet
C++ btest.cpp
BtrieveClient btrieveClient;
Python btest.py
btrieveClient = btrievePython.BtrieveClient()
assert(btrieveClient != None)

◆ ~BtrieveClient()

BtrieveClient::~BtrieveClient ( )

Member Function Documentation

◆ CollectionClose()

Btrieve::StatusCode BtrieveClient::CollectionClose ( BtrieveCollection * btrieveCollection)

Close a collection.

Parameters
[in]btrieveCollectionThe Btrieve collection.
Snippet
C++ bcollection.cpp
// If CollectionClose() fails.
if ((status = btrieveClient->CollectionClose(btrieveCollection)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::CollectionClose():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveClient.CollectionClose(btrieveCollection)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::CollectionClose():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bcollection.cpp.

◆ CollectionCreate()

Btrieve::StatusCode BtrieveClient::CollectionCreate ( const char * collectionName)

Create a collection.

Parameters
[in]collectionNameThe collection name.
Snippet
C++ bcollection.cpp
// If CollectionCreate() fails.
if ((status = btrieveClient->CollectionCreate(btrieveCollectionName)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::CollectionCreate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveClient.CollectionCreate(btrieveCollectionName)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::CollectionCreate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bcollection.cpp.

◆ CollectionDelete()

Btrieve::StatusCode BtrieveClient::CollectionDelete ( const char * collectionName)

Delete a collection.

Parameters
[in]collectionNameThe collection name.
Snippet
C++ bcollection.cpp
// If CollectionDelete() fails.
if ((status = btrieveClient->CollectionDelete(btrieveCollectionName)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::CollectionDelete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveClient.CollectionDelete(btrieveCollectionName)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::CollectionDelete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bcollection.cpp.

◆ CollectionOpen()

Btrieve::StatusCode BtrieveClient::CollectionOpen ( BtrieveCollection * btrieveCollection,
const char * collectionName,
const char * password = NULL )

Open a collection.

Parameters
[out]btrieveCollectionThe Btrieve collection.
[in]collectionNameThe collection name.
[in]passwordThe password.
Snippet
C++ bcollection.cpp
// If CollectionOpen() fails.
if ((status = btrieveClient->CollectionOpen(btrieveCollection, btrieveCollectionName)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::CollectionOpen():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveClient.CollectionOpen(btrieveCollection, btrieveCollectionName)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::CollectionOpen():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bcollection.cpp.

◆ CollectionRename()

Btrieve::StatusCode BtrieveClient::CollectionRename ( const char * existingCollectionName,
const char * newCollectionName )

Rename a collection.

Parameters
[in]existingCollectionNameThe existing collection name.
[in]newCollectionNameThe new collection name.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ ContinuousOperationBegin() [1/2]

Btrieve::StatusCode BtrieveClient::ContinuousOperationBegin ( const char * pathNames)

Begin continuous operation.

Parameters
[in]pathNamesThe path names.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ ContinuousOperationBegin() [2/2]

Btrieve::StatusCode BtrieveClient::ContinuousOperationBegin ( const wchar_t * pathNames)

Begin continuous operation.

Parameters
[in]pathNamesThe path names.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ ContinuousOperationEnd() [1/2]

Btrieve::StatusCode BtrieveClient::ContinuousOperationEnd ( const char * pathNames)

End continuous operation.

Parameters
[in]pathNamesThe path names.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ ContinuousOperationEnd() [2/2]

Btrieve::StatusCode BtrieveClient::ContinuousOperationEnd ( const wchar_t * pathNames)

End continuous operation.

Parameters
[in]pathNamesThe path names.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileClose()

Btrieve::StatusCode BtrieveClient::FileClose ( BtrieveFile * btrieveFile)

Close a file.

Parameters
[in]btrieveFileThe Btrieve file.
Snippet
C++ btest.cpp
// If FileClose() fails.
if ((status = btrieveClient->FileClose(btrieveFile)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileClose():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileClose(btrieveFile)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileClose():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
Test_BTRV2.cpp, bfileattributes.cpp, bfileinformation.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, and btestvlr.cpp.

◆ FileCreate() [1/4]

Btrieve::StatusCode BtrieveClient::FileCreate ( BtrieveFileAttributes * btrieveFileAttributes,
BtrieveIndexAttributes * btrieveIndexAttributes,
const char * fileName,
Btrieve::CreateMode createMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Create a file.

Parameters
[in]btrieveFileAttributesThe file attributes.
[in]btrieveIndexAttributesThe index attributes.
[in]fileNameThe file name.
[in]createModeThe create mode.
[in]locationModeThe location mode.
Snippet
C++ btest.cpp
// If FileCreate() fails.
if ((status = btrieveClient->FileCreate(&btrieveFileAttributes, btrieveFileName, Btrieve::CREATE_MODE_OVERWRITE)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileCreate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileCreate(btrieveFileAttributes, btrieveFileName, btrievePython.Btrieve.CREATE_MODE_OVERWRITE)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileCreate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileCreate() [2/4]

Btrieve::StatusCode BtrieveClient::FileCreate ( BtrieveFileAttributes * btrieveFileAttributes,
BtrieveIndexAttributes * btrieveIndexAttributes,
const wchar_t * fileName,
Btrieve::CreateMode createMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Create a file.

Parameters
[in]btrieveFileAttributesThe file attributes.
[in]btrieveIndexAttributesThe index attributes.
[in]fileNameThe file name.
[in]createModeThe create mode.
[in]locationModeThe location mode.
Snippet
C++ btest.cpp
// If FileCreate() fails.
if ((status = btrieveClient->FileCreate(&btrieveFileAttributes, btrieveFileName, Btrieve::CREATE_MODE_OVERWRITE)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileCreate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileCreate(btrieveFileAttributes, btrieveFileName, btrievePython.Btrieve.CREATE_MODE_OVERWRITE)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileCreate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileCreate() [3/4]

Btrieve::StatusCode BtrieveClient::FileCreate ( BtrieveFileAttributes * btrieveFileAttributes,
const char * fileName,
Btrieve::CreateMode createMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Create a file.

Parameters
[in]btrieveFileAttributesThe file attributes.
[in]fileNameThe file name.
[in]createModeThe create mode.
[in]locationModeThe location mode.
Snippet
C++ btest.cpp
// If FileCreate() fails.
if ((status = btrieveClient->FileCreate(&btrieveFileAttributes, btrieveFileName, Btrieve::CREATE_MODE_OVERWRITE)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileCreate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileCreate(btrieveFileAttributes, btrieveFileName, btrievePython.Btrieve.CREATE_MODE_OVERWRITE)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileCreate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
Test_BTRV2.cpp, bfileattributes.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, and btestvlr.cpp.

◆ FileCreate() [4/4]

Btrieve::StatusCode BtrieveClient::FileCreate ( BtrieveFileAttributes * btrieveFileAttributes,
const wchar_t * fileName,
Btrieve::CreateMode createMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Create a file.

Parameters
[in]btrieveFileAttributesThe file attributes.
[in]fileNameThe file name.
[in]createModeThe create mode.
[in]locationModeThe location mode.
Snippet
C++ btest.cpp
// If FileCreate() fails.
if ((status = btrieveClient->FileCreate(&btrieveFileAttributes, btrieveFileName, Btrieve::CREATE_MODE_OVERWRITE)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileCreate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileCreate(btrieveFileAttributes, btrieveFileName, btrievePython.Btrieve.CREATE_MODE_OVERWRITE)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileCreate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileDelete() [1/2]

Btrieve::StatusCode BtrieveClient::FileDelete ( const char * fileName)

Delete a file.

Parameters
[in]fileNameThe file name.
Snippet
C++ btest.cpp
// If FileDelete() fails.
if ((status = btrieveClient->FileDelete(btrieveFileName)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileDelete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileDelete(btrieveFileName)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileDelete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bfileattributes.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, and btestvlr.cpp.

◆ FileDelete() [2/2]

Btrieve::StatusCode BtrieveClient::FileDelete ( const wchar_t * fileName)

Delete a file.

Parameters
[in]fileNameThe file name.
Snippet
C++ btest.cpp
// If FileDelete() fails.
if ((status = btrieveClient->FileDelete(btrieveFileName)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileDelete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileDelete(btrieveFileName)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileDelete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileOpen() [1/2]

Btrieve::StatusCode BtrieveClient::FileOpen ( BtrieveFile * btrieveFile,
const char * fileName,
const char * ownerName,
Btrieve::OpenMode openMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Open a file.

Parameters
[out]btrieveFileThe Btrieve file.
[in]fileNameThe file name.
[in]ownerNameThe owner name.
[in]openModeThe open mode.
[in]locationModeThe location mode.
Snippet
C++ btest.cpp
// If FileOpen() fails.
if ((status = btrieveClient->FileOpen(btrieveFile, btrieveFileName, NULL, Btrieve::OPEN_MODE_NORMAL)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileOpen():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveClient.FileOpen(btrieveFile, btrieveFileName, None, btrievePython.Btrieve.OPEN_MODE_NORMAL)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileOpen():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
Test_BTRV2.cpp, bfileattributes.cpp, bfileinformation.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, and btestvlr.cpp.

◆ FileOpen() [2/2]

Btrieve::StatusCode BtrieveClient::FileOpen ( BtrieveFile * btrieveFile,
const wchar_t * fileName,
const char * ownerName,
Btrieve::OpenMode openMode,
Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE )

Open a file.

Parameters
[out]btrieveFileThe Btrieve file.
[in]fileNameThe file name.
[in]ownerNameThe owner name.
[in]openModeThe open mode.
[in]locationModeThe location mode.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileRename() [1/2]

Btrieve::StatusCode BtrieveClient::FileRename ( const char * existingFileName,
const char * newFileName )

Rename a file.

Parameters
[in]existingFileNameThe existing file name.
[in]newFileNameThe new file name.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ FileRename() [2/2]

Btrieve::StatusCode BtrieveClient::FileRename ( const wchar_t * existingFileName,
const wchar_t * newFileName )

Rename a file.

Parameters
[in]existingFileNameThe existing file name.
[in]newFileNameThe new file name.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ GetClientIdentifier()

int BtrieveClient::GetClientIdentifier ( )

Get the client identifier.

Return values
>= 0The client identifier.
-1An error has occurred. Use BtrieveClient::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.

◆ GetCurrentDirectory() [1/3]

const char * BtrieveClient::GetCurrentDirectory ( Btrieve::DiskDrive diskDrive)

Get the current directory.

Note
This method is not thread safe. The string returned will be overwritten on subsequent calls.
Parameters
[in]diskDriveThe disk drive. Non-Windows based systems must use DISK_DRIVE_DEFAULT.
Return values
!= NULLThe current directory.
NULLAn error has occurred. Use BtrieveClient::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.

◆ GetCurrentDirectory() [2/3]

Btrieve::StatusCode BtrieveClient::GetCurrentDirectory ( Btrieve::DiskDrive diskDrive,
char * currentDirectory,
int currentDirectorySize )

Get the current directory.

Note
This method is available only in C++.
Parameters
[in]diskDriveThe disk drive. Non-Windows based systems must use DISK_DRIVE_DEFAULT.
[out]currentDirectoryThe current directory.
[in]currentDirectorySizeThe current directory size.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ GetCurrentDirectory() [3/3]

Btrieve::StatusCode BtrieveClient::GetCurrentDirectory ( Btrieve::DiskDrive diskDrive,
wchar_t * currentDirectory,
int currentDirectorySize )

Get the current directory.

Parameters
[in]diskDriveThe disk drive. Non-Windows based systems must use DISK_DRIVE_DEFAULT.
[out]currentDirectoryThe current directory.
[in]currentDirectorySizeThe current directory size.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ GetLastStatusCode()

Btrieve::StatusCode BtrieveClient::GetLastStatusCode ( )

Get the last status code.

Note
This method is intended for use following methods which don't return a status code.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ GetServiceAgentIdentifier()

int BtrieveClient::GetServiceAgentIdentifier ( )

Get the service agent identifier.

Return values
>= 0The service agent identifier.
-1An error has occurred. Use BtrieveClient::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.

◆ GetVersion()

Btrieve::StatusCode BtrieveClient::GetVersion ( BtrieveVersion * btrieveVersion,
BtrieveFile * btrieveFile = NULL )

Get the version.

Parameters
[out]btrieveVersionThe version.
[in]btrieveFileThe Btrieve file.
Snippet
C++ bversion.cpp
// If GetVersion() fails.
if ((status = btrieveClient->GetVersion(&btrieveVersion)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::GetVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bversion.py
rc = btrieveClient.GetVersion(btrieveVersion)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::GetVersion():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bversion.cpp.

◆ Login() [1/2]

Btrieve::StatusCode BtrieveClient::Login ( const char * databaseURI)

Login.

Parameters
[in]databaseURIThe database uniform resource indicator.
Snippet
C++ bversion.cpp
// If Login() fails.
if ((status = btrieveClient->Login(databaseURI)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::Login():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bversion.py
rc = btrieveClient.Login(databaseURI)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::Login():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bversion.cpp.

◆ Login() [2/2]

Btrieve::StatusCode BtrieveClient::Login ( const wchar_t * databaseURI)

Login.

Parameters
[in]databaseURIThe database uniform resource indicator.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ Logout() [1/2]

Btrieve::StatusCode BtrieveClient::Logout ( const char * databaseURI)

Logout.

Parameters
[in]databaseURIThe database uniform resource indicator.
Snippet
C++ bversion.cpp
// If Logout() fails.
if ((status = btrieveClient->Logout(databaseURI)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::Logout():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bversion.py
rc = btrieveClient.Logout(databaseURI)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::Logout():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bversion.cpp.

◆ Logout() [2/2]

Btrieve::StatusCode BtrieveClient::Logout ( const wchar_t * databaseURI)

Logout.

Parameters
[in]databaseURIThe database uniform resource indicator.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ Reset()

Btrieve::StatusCode BtrieveClient::Reset ( )

Reset.

Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetCurrentDirectory() [1/2]

Btrieve::StatusCode BtrieveClient::SetCurrentDirectory ( const char * currentDirectory)

Set the current directory.

Parameters
[in]currentDirectoryThe current directory.
Description
Current directory defaults to the current working directory.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetCurrentDirectory() [2/2]

Btrieve::StatusCode BtrieveClient::SetCurrentDirectory ( const wchar_t * currentDirectory)

Set the current directory.

Parameters
[in]currentDirectoryThe current directory.
Description
Current directory defaults to the current working directory.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ Stop()

Btrieve::StatusCode BtrieveClient::Stop ( )

Stop.

Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ TransactionAbort()

Btrieve::StatusCode BtrieveClient::TransactionAbort ( )

Abort a transaction.

Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ TransactionBegin()

Btrieve::StatusCode BtrieveClient::TransactionBegin ( Btrieve::TransactionMode transactionMode,
Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE )

Begin a transaction.

Parameters
[in]transactionModeThe transaction mode.
[in]lockModeThe lock mode.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ TransactionEnd()

Btrieve::StatusCode BtrieveClient::TransactionEnd ( )

End a transaction.

Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString