📄 dbfile.h
字号:
// dbfile.h : defines the interface for the CDBaseFile class
// This is a part of the Objective Grid C++ Library.
// Copyright (C) 1995 ClassWorks, Stefan Hoenig.
// All rights reserved.
//
// This source code is only intended as a supplement to
// the Objective Grid Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding
// the Objective Grid product.
//
#ifndef _DBFILE_H_
#define _DBFILE_H_
class CField
{
public:
enum FieldType {
charField = 'C',
dateField = 'D',
numericField = 'N',
logicalField = 'L',
memoField = 'M'
};
char name[11]; // dbf field names are 10 chars long max.
char type;
short len;
short width;
short decimals;
int offset;
};
// long nCurrentWriteRecord; // Current write record
// char* writeBuf; // buffer for writing records
class CDBaseFile
{
public:
CDBaseFile();
~CDBaseFile();
BOOL Open(LPCTSTR szFileName, BOOL readOnly = FALSE);
void Close();
CString sFileName; // sFileName
FILE* fd; // File handle
long nRecordCount; // No. of records
long nCurrentRecord; // Current read record
int nFieldCount; // No. of fields
CPtrArray fieldArray; // Array with fields
char* recordBuf; // buffer for reading records
BOOL bReadOnly;
BOOL bWriteFlag;
BOOL Seek(long nRecord);
void Flush();
CField* GetField(int n) const;
BOOL GetValue(int n, CString& result) const;
BOOL IsDeleted() const;
BOOL SetValue(int n, LPCTSTR s);
int InitFields();
short offset;
short size;
};
#endif // _DBFILE_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -