📄 fileform.h
字号:
#ifndef FILEFORM_H
#define FILEFORM_H
#include <iostream.h>
class mgcFileFormat
{
// data base management system
public:
typedef int (*FFquery)(char*);
typedef int (*FFgethead)(char*,int*,int**,char*,int*);
typedef int (*FFputhead)(char*,int,const int*,const char*,int);
typedef int (*FFdata)(char*,long,int,char*);
typedef int (*FFmessage)(char*,void*);
typedef struct {
int id;
FFquery query;
FFgethead gethead;
FFputhead puthead;
FFdata getdata;
FFdata putdata;
FFmessage getmessage;
FFmessage putmessage;
} RegisteredFileFormat;
static int CreateDataBase ();
static void DestroyDataBase ();
static int AddFileFormat (
FFquery query,
FFgethead gethead,
FFputhead puthead,
FFdata getdata,
FFdata putdata,
FFmessage getmessage,
FFmessage putmessage
);
static int not_openable;
static int not_recognized;
static int Query (char* filename);
static int Valid (int id)
{ return (0 <= id && id < registered); }
static RegisteredFileFormat& RFF (int id)
{ return fileformat[id]; }
static int default_format;
private:
static int maxregistered;
static int registered;
static RegisteredFileFormat* fileformat;
// error handling
public:
static int verbose;
static unsigned error;
static void Report (ostream& ostr);
private:
static const unsigned allocation_failed;
static const unsigned exceeded_maximum;
static const char* message[2];
static int Number (unsigned single_error);
static void Report (unsigned single_error);
};
// automatic creation of data base
static int create_fdb = mgcFileFormat::CreateDataBase();
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -