message_file.h 521 B

123456789101112131415161718192021222324252627
  1. #ifndef _MESSAGE_PARSE_HPP_
  2. #define _MESSAGE_PARSE_HPP_
  3. #include <stdint.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. struct message_file
  7. {
  8. private:
  9. bool m_owner;
  10. FILE* m_file;
  11. char m_last_line[256];
  12. message_file(const message_file&);
  13. public:
  14. message_file(const char*fname);
  15. message_file(FILE*fp);
  16. ~message_file();
  17. int get_line(uint64_t*time,char*buf,int buflen);
  18. int put_line(uint64_t time,char*buf,int buflen);
  19. time_t parseLine(std::string tmp);
  20. time_t GetTimeStampByStr( const char* pDate);
  21. };
  22. #endif