PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBDBMgr
Wrapper Class for the IDBMgr interface.
#include <SFBDBMgr.h.hpp>
class SFBDBMgr : public SFBBase;
SFMTYPEDEFWRAPPER(SFBDBMgr)

Inheritance diagram

 Inheritance diagram of SFBDBMgrClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IDBMgr

Member

Public Functions
static
SFBDBMgrSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBDBMgr instance.
static
SFBDBMgrSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBDBMgr instance.
SFBDatabaseSmp OpenDatabase( ACharConstPtr fileName , Bool create )
Open the specified database.
SFBDatabaseSmp OpenDatabase( SFXAnsiStringConstRef fileName , Bool create )
Open the specified database.
SFBDatabaseSmp OpenDatabaseEx( ACharConstPtr fileName , Bool create , UInt32 minSize , UInt16 minRecs )
Open the specified database.
SFBDatabaseSmp OpenDatabaseEx( SFXAnsiStringConstRef fileName , Bool create , UInt32 minSize , UInt16 minRecs )
Open the specified database.
SFCError Remove( ACharConstPtr fileName )
Remove the specified database.
SFCError Remove( SFXAnsiStringConstRef fileName )
Remove the specified database.
Void SetCacheSize( SInt32 size )
Set the size for file-caching operations on the database.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBDBMgr::NewInstance
Create a new SFBDBMgr instance.
[ public, static ]
SFBDBMgrSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBDBMgrSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBDBMgr::OpenDatabase
Open the specified database.
[ public ]
SFBDatabaseSmp OpenDatabase(
    ACharConstPtr fileName   // null terminated string denoting the database file name
    Bool create              // specifies if the database must be created if the database is not found. 
                             // the database is created only if this flag is set to true
);
[ public ]
SFBDatabaseSmp OpenDatabase(
    SFXAnsiStringConstRef fileName   // null terminated string denoting the database file name
    Bool create                      // specifies if the database must be created if the database is not found. 
                                     // the database is created only if this flag is set to true
);

Example

Create a database.

// create SFBDataMgr interface
SFBDBMgrSmp     dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp  database;

// create a database
database = dbmgr->OpenDatabase("MyDataBase.db",  // database name.
                               true);            // specifies if the database must be created.
                                                 // true : Create a database
                                                 // false : Will not Create a database.

Reference

BREW API IDBMGR_OpenDatabase | SFBDBMgr::OpenDatabaseEx


SFBDBMgr::OpenDatabaseEx
Open the specified database.
[ public ]
SFBDatabaseSmp OpenDatabaseEx(
    ACharConstPtr fileName   // null terminated string denoting the database file name
    Bool create              // specifies if the database must be created if the database is not found.
                             // the database is created only if this flag is set to true
    UInt32 minSize           // minimum size of the records in the database
    UInt16 minRecs           // minimum number of records that the database should hold
);
[ public ]
SFBDatabaseSmp OpenDatabaseEx(
    SFXAnsiStringConstRef fileName   // null terminated string denoting the database file name
    Bool create                      // specifies if the database must be created if the database is not found.
                                     // the database is created only if this flag is set to true
    UInt32 minSize                   // minimum size of the records in the database
    UInt16 minRecs                   // minimum number of records that the database should hold
);

Example

Specify minimum size and minimum number of the records in database, and create a database.

// create SFBDataMgr interface
SFBDBMgrSmp     dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp  database;

// specify minimum size and minimum number of the records in database, and create a database
database = dbmgr->OpenDatabaseEx("MyDataBase.db",  // database name
                                 true,             // specifies if the database must be created. ( true / false )
                                 0,                // minimum size of the records
                                 0);               // minimum numbers of the records

Reference

BREW API IDBMGR_OpenDatabaseEx | SFBDBMgr::OpenDatabase


SFBDBMgr::Remove
Remove the specified database.
[ public ]
SFCError Remove(
    ACharConstPtr fileName   // null terminated string specifying the name of the database to be removed
);
[ public ]
SFCError Remove(
    SFXAnsiStringConstRef fileName   // null terminated string specifying the name of the database to be removed
);

Example

Removes the specified database.

// create SFBDataMgr interface
SFBDBMgrSmp     dbmgr = SFBDBMgr::NewInstance();

// removes the specified database
dbmgr->Remove("MyDataBase.db");

Reference

BREW API IDBMGR_Remove


SFBDBMgr::SetCacheSize
Set the size for file-caching operations on the database.
[ public ]
Void SetCacheSize(
    SInt32 size   // size of cache
);

Reference

BREW API IDBMGR_SetCacheSize