📄 democommon.h
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -