2012-06-14 13:06:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2014-08-12 17:32:08 +01:00
|
|
|
#include "Logger.h"
|
2012-06-14 13:06:06 +00:00
|
|
|
#include <time.h>
|
2015-08-05 01:24:59 +03:00
|
|
|
#include <chrono>
|
2012-06-14 13:06:06 +00:00
|
|
|
// tolua_begin
|
|
|
|
|
|
2014-05-01 23:38:35 +02:00
|
|
|
inline unsigned int GetTime()
|
2012-06-14 13:06:06 +00:00
|
|
|
{
|
2015-12-19 14:30:32 +00:00
|
|
|
// NB: For caveats, please see https://stackoverflow.com/a/14505248
|
2015-08-05 01:24:59 +03:00
|
|
|
return static_cast<unsigned int>(std::chrono::seconds(time(0)).count());
|
2012-06-14 13:06:06 +00:00
|
|
|
}
|
|
|
|
|
|
2014-07-21 15:19:48 +02:00
|
|
|
inline std::string GetChar( std::string & a_Str, unsigned int a_Idx)
|
2012-06-14 13:06:06 +00:00
|
|
|
{
|
|
|
|
|
return std::string(1, a_Str[ a_Idx ]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// tolua_end
|