📄 source.h
字号:
#ifndef SOURCE_H#define SOURCE_H#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <iostream.h>#include "util.h"#define MAXLEN 4096typedef float Description;class Source {private: FILE *handle; char *fname; char delimiter[1024]; char *where, *buffer; int n_Instances; // the number of rows int n_Descriptions; // the number of columnspublic: Source(char delim[]=",", char *fname=NULL); void init(); // reset the file pointer to the beginning Description readDescription(); // read a description void setDelimiter(char *delim) { strcpy(delimiter, delim); } int numOfInstances() { return n_Instances; } int numOfDescriptions() { return n_Descriptions; } // status() will give a status after read a char from the // input Description *readOneInstance(); char *getFileName() { return fname; } FILE* getFileHandle() { return handle; }private: int countInstances(); int countDescriptions(); // class column also counted};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -