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

The Btrieve document set class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveDocumentSet ()
 
 ~BtrieveDocumentSet ()
 
Btrieve::StatusCode GetLastStatusCode ()
 Get the last status code.
 
int PopFirst ()
 Remove and return the first document identifier from the set.
 
int PopLast ()
 Remove and return the last document identifier from the set.
 
int Size ()
 Return the number of document identifiers in the set.
 

Detailed Description

The Btrieve document set class.

Note
This class is currently a beta release; feedback about usage and suggestions for improvements are requested, and can be submitted at https://communities.actian.com/s/actian-zen.

The document set is an ordered set.

Examples
bcollection.cpp.

Constructor & Destructor Documentation

◆ BtrieveDocumentSet()

BtrieveDocumentSet::BtrieveDocumentSet ( )
Snippet
C++ bcollection.cpp
BtrieveDocumentSet btrieveDocumentSet;
Python bcollection.py
btrieveDocumentSet = btrievePython.BtrieveDocumentSet()
assert(btrieveDocumentSet != None)
See also
BtrieveCollection::Query

◆ ~BtrieveDocumentSet()

BtrieveDocumentSet::~BtrieveDocumentSet ( )

Member Function Documentation

◆ GetLastStatusCode()

Btrieve::StatusCode BtrieveDocumentSet::GetLastStatusCode ( )

Get the last status code.

Note
This method is intended for use following methods which don't return a status code.
Snippet
C++ bcollection.cpp
if ((size = btrieveDocumentSet.Size()) < 0)
{
status = btrieveDocumentSet.GetLastStatusCode();
printf("Error: BtrieveDocumentSet::Size():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveDocumentSet.Size()
assert(rc >= 0), "Error: BtrieveDocumentSet::Size():%d:%s\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveDocumentSet.GetLastStatusCode()))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples
bcollection.cpp.

◆ PopFirst()

int BtrieveDocumentSet::PopFirst ( )

Remove and return the first document identifier from the set.

Snippet
C++ bcollection.cpp
if ((id = btrieveDocumentSet.PopFirst()) < 0)
{
status = btrieveDocumentSet.GetLastStatusCode();
printf("Error: BtrieveDocumentSet::PopFirst():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveDocumentSet.PopFirst()
assert(rc >= 0), "Error: BtrieveDocumentSet::Size():%d:%s\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveDocumentSet.GetLastStatusCode()))
Return values
>= 0The popped document identifier.
-1An error has occurred. Use BtrieveDocumentSet::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bcollection.cpp.

◆ PopLast()

int BtrieveDocumentSet::PopLast ( )

Remove and return the last document identifier from the set.

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

◆ Size()

int BtrieveDocumentSet::Size ( )

Return the number of document identifiers in the set.

Snippet
C++ bcollection.cpp
if ((size = btrieveDocumentSet.Size()) < 0)
{
status = btrieveDocumentSet.GetLastStatusCode();
printf("Error: BtrieveDocumentSet::Size():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bcollection.py
rc = btrieveDocumentSet.Size()
assert(rc >= 0), "Error: BtrieveDocumentSet::Size():%d:%s\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveDocumentSet.GetLastStatusCode()))
Return values
>= 0The number of document identifiers in the set.
-1An error has occurred. Use BtrieveDocumentSet::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples
bcollection.cpp.