⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tddatabase.h

📁 This is the main project file for VC++ projects generated using an Application Wizard. It cont
💻 H
字号:
#pragma once
#include <stdio.h>
#include "TDDBStructs.h"
#include "TDRecord.h"

#define TDDB_OK						0
#define TDDBERR_READ_ERROR			1
#define TDDBERR_COULD_NOT_OPEN		2
#define TDDBERR_NO_COLUMNS			3
#define TDDBERR_FILE_NOT_FOUND		4
#define TDDBERR_WRITE_ERROR			5
#define TDDBERR_PREPARE_ERROR		6
#define TDDBERR_INVALID_RECORD		7
#define TDDBERR_SEEK_ERROR			8
#define TDDBERR_DATABASE_NOT_OPEN	9


const char* TDDB_ErrorCodeToString( int iErrorCode );

class CTDDatabase
{
////////////////////////////////////////////////////////////////////////
//	Public Interface
////////////////////////////////////////////////////////////////////////
public:
	CTDDatabase(void);
	~CTDDatabase(void);

	int Open( const char* szFileName );
	int Close( void );
	int IsOpen( void );
	int CreateNew( const char* szFileName, TDDBTable* tableDef );

	CTDRecord CreateRecord( void );
	int GetRecord( CTDRecord* recordOut, unsigned int iIndex );
	int SetRecord( CTDRecord* recordIn, unsigned int iIndex );
	int AddRecord( CTDRecord* recordIn );
	int DeleteRecord( unsigned int iIndex );
	int GetRecordCount( unsigned int* lpiCount );
	int GetValidRecordCount( unsigned int* lpiCount );

////////////////////////////////////////////////////////////////////////
//	Private Interface
////////////////////////////////////////////////////////////////////////
private:
	FILE*		_lpFile;
	TDDBTable	_tableDef;
	long		_lFirstRecord;

	int				ResetEverything( void );
	long			GetRecordOffset( unsigned int iIndex );
	unsigned int	GetRecordSizeInBytes( void );
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -