LogFile_WIN32.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // LogFile_WIN32.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/LogFile_WIN32.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Logging
  8. // Module: LogFile
  9. //
  10. // Definition of the LogFileImpl class using the Windows file APIs.
  11. //
  12. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_LogFile_WIN32_INCLUDED
  18. #define Foundation_LogFile_WIN32_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/Timestamp.h"
  21. #include "Poco/UnWindows.h"
  22. namespace Poco {
  23. class Foundation_API LogFileImpl
  24. /// The implementation of LogFile for Windows.
  25. /// The native filesystem APIs are used for
  26. /// total control over locking behavior.
  27. {
  28. public:
  29. LogFileImpl(const std::string& path);
  30. ~LogFileImpl();
  31. void writeImpl(const std::string& text, bool flush);
  32. UInt64 sizeImpl() const;
  33. Timestamp creationDateImpl() const;
  34. const std::string& pathImpl() const;
  35. private:
  36. void createFile();
  37. std::string _path;
  38. HANDLE _hFile;
  39. Timestamp _creationDate;
  40. };
  41. } // namespace Poco
  42. #endif // Foundation_LogFile_WIN32_INCLUDED