123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef __LOAD_BIN_
- #define __LOAD_BIN_
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <string.h>
- #include <fcntl.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- #include <dirent.h>
- #include "common_tool.h"
- #include <log.h>
- using namespace std;
- #define FILEBUFFER_LENGTH 4096 //4k
- #define EMPTY_STR ""
- class load_raw
- {
- public:
- bool load_folder(string folder_path);
- bool load_file(string file_path);
- load_raw();
- static int m_index;
- static std::vector<std::string> m_vec_date;
- static std::string m_date;
- static bool m_is_history;
- protected:
- private:
- bool init();
- bool deal_with_time(string text_line);
- bool deal_with_raw(string text_line);
- void listDir(const char *path,vector<string>& vec_file_path);
- string raw_time;
- int raw_length = 0;
- char raw[FILEBUFFER_LENGTH] = { 0 };
- int m_port;
- int c_fd;
- };
- #endif
|