// Util.h
// ``````

#pragma once

#include <map>
#include <string>
#include <vector>

// Project string types
#ifdef _WIN32
	#include <tchar.h>
	#ifdef UNICODE
		#define TSTRING std::wstring
	#else
		#define TSTRING std::string
	#endif
#else
	#define _T(x) (x)
	#define TCHAR char
	#define TSTRING std::string	
#endif

// Types

typedef std::map<std::string,std::map<std::string,std::string>> ini_t;

// Functions in Util.cpp

ini_t   ini_parse(TSTRING filepath);
bool    file_get_contents(std::wstring filepath, std::string& result);
bool    file_get_contents(std::string filepath, std::string& result);
void    explode(std::vector<std::string> &res, std::string &haystack, const char* needle);
std::string format(const char *fmt, ...);
void    replace(std::string& str, const char* find, const char* replace);
std::string timestamp();

// OS-Specific functions

void    releaseTimeslice();
long    getUpTicks();