#include "xfileinf.h"
#include "XDate.h"
#include "XTime.h"


/*@ XFileInfo::GetCreationDate(XDate * date)
@group get information
@remarks Query the date when the file was created.
@parameters  XDate * buffer    buffer to hold the data
*/
void XFileInfo::GetCreationDate(XDate * date)
{
	date->d.days = buffer.fdateCreation.day;
	date->d.months = buffer.fdateCreation.month;
	date->d.years = buffer.fdateCreation.year + 1980;
}


/*@ XFileInfo::GetCreationTime(XTime * time)
@group get information
@remarks Query the time when the file was created.
@parameters  XTime * buffer    buffer to hold the data
*/
void XFileInfo::GetCreationTime(XTime * time)
{
	time->t.seconds = buffer.ftimeCreation.twosecs * 2;
	time->t.minutes = buffer.ftimeCreation.minutes;
	time->t.hours = buffer.ftimeCreation.hours;
}


/*@ XFileInfo::GetLastWriteDate(XDate * date)
@group get information
@remarks Query the date of last write-access
@parameters  XDate * buffer    buffer to hold the data
*/
void XFileInfo::GetLastWriteDate(XDate * date)
{
	date->d.days = buffer.fdateLastWrite.day;
	date->d.months = buffer.fdateLastWrite.month;
	date->d.years = buffer.fdateLastWrite.year + 1980;
}


/*@ XFileInfo::GetLastWriteTime(XTime * time)
@group get information
@remarks Query the time of last write-access
@parameters  XTime * buffer    buffer to hold the data
*/
void XFileInfo::GetLastWriteTime(XTime * time)
{
	time->t.seconds = buffer.ftimeLastWrite.twosecs * 2;
	time->t.minutes = buffer.ftimeLastWrite.minutes;
	time->t.hours = buffer.ftimeLastWrite.hours;
}


/*@ XFileInfo::GetFileSize(void)
@group get information
@remarks Query the size of the file.
@returns ULONG size
*/
ULONG XFileInfo::GetFileSize(void) const
{
	return buffer.cbFile;
}


/*@ XFileInfo::GetFileAttributes(void)
@group get information
@remarks Query the files attributes
@returns LONG attributes
*/
LONG XFileInfo::GetFileAttributes(void) const
{
	return buffer.attrFile;
}

