democommon.h

来自「数据库管理软件,具有很多功能,应用DBS数据库」· C头文件 代码 · 共 73 行

H
73
字号
// demoCommon.h : header file
//

#ifndef __DEMOCOMMON_H__
#define __DEMOCOMMON_H__


/////////////////////////////////////////////////////////////////////////////
// type definition //
/////////////////////////////////////////////////////////////////////////////

typedef enum valType {_INTEGER, _DOUBLE, _DATE, _TIME, _STRING, _ERRTYPE=-1} fieldType;

typedef enum compareOperation {_GT,_GE,_EQ,_NE,_LT,_LE} cmpOp; // >, >=, ==, !=, <, <=


// file head
struct fileHeader
{ char ver[32]; // version
  short fcnt; // count of all fields
  short rlen; // length of a record
  int rcnt; // count of all records
};

// field description
struct fieldDesc
{ char fName[16]; // field name
  fieldType fType; // field type
  short fLen; // field length
  int offset; // offset
};

// query instruction struct
struct inst
{
	char fName[16];
	char op[4];
	char val[32];
	fieldType fType;
	short fLen;
	unsigned offset;
};

// query condition struct
struct queryCondition
{
	inst queryInst[32]; // instructions
	int icnt; // instruction count
	int orIndex[10]; // OR instruction index in queryInst
					 // format: "or ( # and # ) or ( # and # ) or"
	int ornumth; // the number of OR, 条件前后各多一个or
};



/////////////////////////////////////////////////////////////////////////////
// function //
/////////////////////////////////////////////////////////////////////////////

// show a item text in CListCtrl
void ShowItemText(CListCtrl& listCtr,int nItem, int nSubItem, CString value);

// make sure the value you input is correct at lest in form
BOOL CheckValue(CString val, valType type, int len);
// (value, valueType, valueLength)

// find does the record meet with the condition
BOOL FindRecord(byte* buf, queryCondition& pqcond);



#endif // __DEMOCOMMON_H__

⌨️ 快捷键说明

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