<commit_before>/*
 * copyright: (c) RDO-Team, 2009
 * filename : rdotime.inl
 * author   :  
 * date     : 10.05.2009
 * bref     : 
 * indent   : 4T
 */

// ====================================================================== INCLUDES
#ifdef RDO_MT
#include <afxwin.h>
#else
#include <windows.h>
#endif
#include <time.h>
// ====================================================================== SYNOPSIS
#include "rdo_common/rdodebug.h"
// ===============================================================================

OPEN_RDO_NAMESPACE

inline Time::Time()
	: m_value(Time::invalid().value())
{}

inline Time::Time(CREF(Value) value)
	: m_value(value)
{}

inline rbool Time::operator== (CREF(Time) time)
{
	return m_value == time.m_value;
}

inline Time::operator Value() const
{
	return m_value;
}

inline tstring Time::asString() const
{
	if (m_value == Time::invalid())
	{
		return _T("[INVALID]");
	}
	else
	{
	    SYSTEMTIME st;
		ASSERT(::FileTimeToSystemTime(reinterpret_cast<CPTR(FILETIME)>(&m_value), &st));
		ruint size;
		//!  
		const tstring timeFormat(_T("HH:mm:ss"));
		size = ::GetTimeFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, timeFormat.c_str(), NULL, 0);
		ASSERT(size != 0);
		tstring time;
		time.resize(size);
		::GetTimeFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, timeFormat.c_str(), &time[0], size);
		//!  
		const tstring dateTimeFormat = rdo::format(_T("ddd MMM dd %s yyyy"), time.c_str());
		size = ::GetDateFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, dateTimeFormat.c_str(), NULL, 0);
		ASSERT(size != 0);
		tstring dateTime;
		dateTime.resize(size);
		::GetDateFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, dateTimeFormat.c_str(), &dateTime[0], size);
		return dateTime;
	}
}
<commit_msg> - удаление нулевого символа<commit_after>/*
 * copyright: (c) RDO-Team, 2009
 * filename : rdotime.inl
 * author   :  
 * date     : 10.05.2009
 * bref     : 
 * indent   : 4T
 */

// ====================================================================== INCLUDES
#ifdef RDO_MT
#include <afxwin.h>
#else
#include <windows.h>
#endif
#include <time.h>
// ====================================================================== SYNOPSIS
#include "rdo_common/rdodebug.h"
// ===============================================================================

OPEN_RDO_NAMESPACE

inline Time::Time()
	: m_value(Time::invalid().value())
{}

inline Time::Time(CREF(Value) value)
	: m_value(value)
{}

inline rbool Time::operator== (CREF(Time) time)
{
	return m_value == time.m_value;
}

inline Time::operator Value() const
{
	return m_value;
}

inline tstring Time::asString() const
{
	if (m_value == Time::invalid())
	{
		return _T("[INVALID]");
	}
	else
	{
	    SYSTEMTIME st;
		ASSERT(::FileTimeToSystemTime(reinterpret_cast<CPTR(FILETIME)>(&m_value), &st));
		ruint size;
		//!  
		const tstring timeFormat(_T("HH:mm:ss"));
		size = ::GetTimeFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, timeFormat.c_str(), NULL, 0);
		ASSERT(size != 0);
		tstring time;
		time.resize(size - 1);
		::GetTimeFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, timeFormat.c_str(), &time[0], size - 1);
		//!  
		const tstring dateTimeFormat = rdo::format(_T("ddd MMM dd %s yyyy"), time.c_str());
		size = ::GetDateFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, dateTimeFormat.c_str(), NULL, 0);
		ASSERT(size != 0);
		tstring dateTime;
		dateTime.resize(size - 1);
		::GetDateFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_USE_CP_ACP, &st, dateTimeFormat.c_str(), &dateTime[0], size - 1);
		return dateTime;
	}
}

{'fraction_non_alphanumeric': 0.2694577128406856, 'fraction_numerical': 0.011801067715650464, 'mean_word_length': 5.379928315412187, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '359400', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1246, 'n_words': 237}