2012-06-14 13:06:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
2014-08-12 16:32:08 +00:00
|
|
|
#include "Logger.h"
|
2012-06-14 13:06:06 +00:00
|
|
|
#include <time.h>
|
2015-08-04 22:24:59 +00:00
|
|
|
#include <chrono>
|
2012-06-14 13:06:06 +00:00
|
|
|
// tolua_begin
|
|
|
|
|
2014-05-01 21:38:35 +00: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-04 22:24:59 +00:00
|
|
|
return static_cast<unsigned int>(std::chrono::seconds(time(0)).count());
|
2012-06-14 13:06:06 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 13:19:48 +00: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
|