logfile.h 838 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __LOGFILE__H__
  2. #define __LOGFILE__H__
  3. /*
  4. ** Include fstream header
  5. */
  6. #ifndef _FSTREAM_
  7. #include <fstream>
  8. using namespace std;
  9. #endif
  10. class CLogFile
  11. {
  12. public:
  13. void PrintCurTime();
  14. CLogFile();
  15. CLogFile(const char* tszFileName);
  16. ~CLogFile();
  17. CLogFile& operator <<(long lVal);
  18. CLogFile& operator <<(const char* str);
  19. CLogFile& operator <<(char tch);
  20. CLogFile& operator <<(int nVal);
  21. CLogFile& operator <<(unsigned long ulVal);
  22. CLogFile& operator <<(double dVal);
  23. CLogFile& operator <<(unsigned int unVal);
  24. CLogFile& operator <<(unsigned __int64 unllVal);
  25. void LOGERROR(char* formatString, ...);
  26. void reset(const char *filePath);
  27. private:
  28. ofstream *m_cOutFile;
  29. void Output( const char* data);
  30. void Init(const char *filePath);
  31. void UnInit();
  32. char logDir[300];
  33. };
  34. #endif // __LOGFILE__H__