2017-01-21 17:27:46 +01:00
|
|
|
|
2017-01-21 23:44:30 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-02-11 18:10:32 +01:00
|
|
|
#include <string>
|
2017-03-04 17:19:36 +01:00
|
|
|
#include <memory>
|
|
|
|
#include <cstdio>
|
|
|
|
|
2017-02-10 00:14:28 +01:00
|
|
|
#include "blupi.h"
|
2017-02-04 16:48:26 +01:00
|
|
|
|
2017-02-12 13:14:22 +01:00
|
|
|
extern void OutputDebug (const char *pMessage);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 13:14:22 +01:00
|
|
|
extern POINT ConvLongToPos (LPARAM lParam);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 13:14:22 +01:00
|
|
|
extern void InitRandom();
|
|
|
|
extern Sint32 Random (Sint32 min, Sint32 max);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-18 17:58:52 +01:00
|
|
|
std::string GetBaseDir ();
|
2017-02-21 22:34:55 +01:00
|
|
|
std::string GetShareDir ();
|
2017-02-18 17:58:52 +01:00
|
|
|
std::string GetLocale ();
|
2017-03-04 17:19:36 +01:00
|
|
|
extern void AddUserPath (std::string &pFilename);
|
|
|
|
|
|
|
|
template<typename ...Args>
|
|
|
|
std::string
|
|
|
|
string_format (const std::string &format, Args ...args)
|
|
|
|
{
|
|
|
|
size_t size = snprintf (nullptr, 0, format.c_str (), args...) + 1;
|
|
|
|
std::unique_ptr<char[]> buf (new char[size]);
|
2017-03-21 18:34:26 +01:00
|
|
|
snprintf (buf.get(), size, format.c_str (), args...);
|
2017-03-04 17:19:36 +01:00
|
|
|
return std::string (buf.get (), buf.get () + size - 1);
|
|
|
|
}
|