#if defined(_WIN32)
#ifndef _COMMON_FILETIME_HPP_
#define _COMMON_FILETIME_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif

class SystemTime;

class FileTime : private FILETIME
{
public:
	FileTime(void);
	FileTime(const FileTime &someFileTime);
	FileTime(const SystemTime &someSystemTime);
	FileTime(const FILETIME &fileTime);
	virtual ~FileTime();
	FileTime &operator=(const FileTime &someFileTime);
	FileTime &operator=(const SystemTime &someSystemTime);
	FileTime &operator=(const FILETIME &someFileTime);
	WORD operator==(const FileTime &someFileTime)const;
	WORD operator>(const FileTime &someFileTime)const;
	WORD operator<(const FileTime &someFileTime)const;
	DWORD lowDateTime(void)const;
	void lowDateTime(DWORD lowDateTime);
	DWORD highDateTime(void)const;
	void highDateTime(DWORD highDateTime);
	FILETIME &getFILETIME(void);
private:
	void zeroInit(void);
};

inline
FileTime::FileTime(void)
{
	zeroInit();
}

inline
FileTime::FileTime(const FileTime &someFileTime)
{
	*this=someFileTime;
}

inline
FileTime::FileTime(const SystemTime &someSystemTime)
{
	*this=someSystemTime;
}

inline
FileTime::FileTime(const FILETIME &fileTime)
{
  *this=fileTime;
}

inline
FileTime::~FileTime()
{
}

inline
FILETIME &FileTime::getFILETIME(void)
{
  return *this;
}

inline
FileTime &FileTime::operator=(const FileTime &someFileTime)
{
	lowDateTime(someFileTime.lowDateTime());
	highDateTime(someFileTime.highDateTime());
	return *this;
}

inline
FileTime &FileTime::operator=(const SystemTime &someSystemTime)
{
	::SystemTimeToFileTime(&((SYSTEMTIME&)((SystemTime&)someSystemTime)),&((FILETIME&)*this));
	return *this;
}

inline
FileTime &FileTime::operator=(const FILETIME &someFileTime)
{
	FILETIME::dwLowDateTime=someFileTime.dwLowDateTime;
	FILETIME::dwHighDateTime=someFileTime.dwHighDateTime;
	return *this;
}

inline
WORD FileTime::operator==(const FileTime &someFileTime)const
{
	return (0==::CompareFileTime(&((FILETIME&)*this),&((FILETIME&)someFileTime)));
}

inline
WORD FileTime::operator>(const FileTime &someFileTime)const
{
	return (1==::CompareFileTime(&((FILETIME&)*this),&((FILETIME&)someFileTime)));
}

inline
WORD FileTime::operator<(const FileTime &someFileTime)const
{
	return (-1==::CompareFileTime(&((FILETIME&)*this),&((FILETIME&)someFileTime)));
}

inline
DWORD FileTime::lowDateTime(void)const
{
	return FILETIME::dwLowDateTime;
}

inline
void FileTime::lowDateTime(DWORD lowDateTime)
{
	FILETIME::dwLowDateTime=lowDateTime;
}

inline
DWORD FileTime::highDateTime(void)const
{
	return FILETIME::dwHighDateTime;
}

inline
void FileTime::highDateTime(DWORD highDateTime)
{
	FILETIME::dwHighDateTime=highDateTime;
}

inline
void FileTime::zeroInit(void)
{
	FILETIME::dwLowDateTime=0L;
	FILETIME::dwHighDateTime=0L;
}
#endif
#endif