1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #pragma once
| #include <fstream>
| #include <vector>
| #include <ctime>
| #include <iomanip>
| #include <sstream>
| #include "struct_data.h"
| #define BUF_MAX_SIZE (8 * 1024) // ¹Ì¶¨°ü´óС8k
| #define FILE_PATH "./" // ºÏ´úÂë×îºÃÐÞ¸Ä
| class SaveFile
| {
| public:
| SaveFile();
| ~SaveFile();
| /*
| if(Head->type == UPLOAD_REQ) ¾Í½øÀ´µ÷ÓÃfileop()º¯Êý¾Í¿ÉÒÔÁË,ÆäËûº¯Êý²»Óõ÷¡£
| */
| int fileop(char* str, int len);
|
| private:
| int fileHead(char* str, int len);
| int fileData(char* str, int len);
| int fileFin(char* str, int len);
| std::vector<std::string> split(const std::string &s, char delimiter);
| std::string curTime();
| private:
| std::string *fileName;
| int flag;
| char *buf;
| SQLFiles instFiles;
| SQLVersions instVersions;
| };
|
|