📄 dbmsengine.h
字号:
/*
* ============================================================================
* Name : CDBMSengine.h
* Part of : DBMSexample
* Created : 02/28/2003 by Forum Nokia
* Implementation notes:
* Version :
* Copyright: Nokia Corporation, 2003
* ============================================================================
*/
#ifndef __DBMS_ENGINE_H__
#define __DBMS_ENGINE_H__
#include <d32dbms.h>
// Class forward declaration
class CDesC16Array;
// Database names don't require a particular file extension
_LIT( KDatabaseName, "c:\\system\\apps\\DBMSexample\\personnel.db" );
#define KDbNameLen 40
#define KDbBirthday 40
#define KMaxSQLLength 256
// If the following macro is defined, the engine will use DBMS C++ API to
// access/create database rather than SQL statements.
// #define USE_DBMS_API
class CDBMSengine : public CBase
{
public:
// Display a message box
void MessageBox(const TDesC &aDes);
// Delete a record from database
void DeleteRecordL();
// Update a record into database
void UpdateRecordL();
// Retrieve a record from database
TBool RetrieveRecordL();
// Retrieve a record according to the name
TBool RetrieveRecordL( const TDes &aName );
// Add a record into database
void AddRecordL();
// Create a database
void CreateL();
// Close a database
void Close();
// Open a database
void OpenL();
//constructor
CDBMSengine();
//destructor
~CDBMSengine();
// Check whether the specified database has been created or not
TBool IsDatabaseCreatedL();
// Read all the records titles
TBool ReadRecordTitlesL(CDesC16Array& aDescriptorList);
// Get record according to the input index
TBool GetRecordByIndexL( TInt aIndex );
// Get the previous record (the database should be opened already)
TBool GetPreviousRecordL();
// Get the next record (the database should be opened already)
TBool GetNextRecordL();
// Get the first record in the database
TBool GetFirstRecordL();
// Getter and setter functions
void SetName( TDes& aName );
void GetName( TDes& aName ) const;
void SetBirthday( TDes& aBirthday);
void GetBirthday( TDes& aBirthday) const;
void SetPersonalId( TInt aPersonalId );
TInt GetPersonalId() const;
void SetSex( TInt aSex );
TInt GetSex() const;
private:
//second phase constructor
void ConstructL();
private:
TBuf< KDbNameLen> iName;
TBuf< KDbNameLen> iOldName;
TInt iSex;
TBuf< KDbBirthday> iBirthday;
TInt iPersonal_id;
TBool iIsDatabaseOpened;
RDbNamedDatabase iDatabase;
RDbs iDbSession;
RDbView iView;
};
#endif // __DBMS_ENGINE_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -