#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_STORAGE_FILESYSTEM_WINDOWS_DATEHELPER_H #define NUCLEX_STORAGE_FILESYSTEM_WINDOWS_DATEHELPER_H #include "Nuclex/Storage/Config.h" #if defined(NUCLEX_STORAGE_WIN32) #include "../../Helpers/WindowsApi.h" // includes minimal Windows.h for ::FILETIME #include // for std::uint64_t #include // for std::time_t namespace Nuclex { namespace Storage { namespace FileSystem { namespace Windows { // ------------------------------------------------------------------------------------------- // /// Some helper methods for dealing with date and time class DateHelper { /// Converts a Microsoft FILETIME into a Posix time stamp /// /// File timestamp reported by a Microsoft API /// /// The equivalent date and time in Posix time format public: static std::time_t PosixTimeFromFileTime(const ::FILETIME &fileTime); #if 0 /// Converts a Microsoft FILETIME into a Posix time stamp /// /// Upper 32 bits of the date and time in Microsoft FILETIME format /// /// /// Lower 32 bits of the date and time in Microsoft FILETIME format /// /// The equivalent date and time in Posix time format public: static std::time_t PosixTimeFromFileTime( std::uint32_t fileTimeHigh, std::uint32_t fileTimeLow ); #endif /// Converts a Microsoft FILETIME into a Posix time stamp /// Date and time in Microsoft FILETIME format /// The equivalent date and time in Posix time format public: static std::time_t PosixTimeFromFileTime( std::uint64_t fileTime ); }; // ------------------------------------------------------------------------------------------- // }}}} // namespace Nuclex::Storage::FileSystem::Windows #endif // defined(NUCLEX_STORAGE_WIN32) #endif // NUCLEX_STORAGE_FILESYSTEM_WINDOWS_DATEHELPER_H