2017-02-25 09:29:34 +08:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
2017-03-23 12:22:02 +08:00
|
|
|
#include <functional>
|
2017-06-18 20:37:45 +08:00
|
|
|
#include "SDLWrapper/IncludeAll.h"
|
2017-02-25 09:29:34 +08:00
|
|
|
|
|
|
|
namespace MiniEngine
|
|
|
|
{
|
2017-03-09 18:52:57 +08:00
|
|
|
class StringEngine
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StringEngine(std::string StringFile,std::string LanguageTag);
|
|
|
|
|
|
|
|
StringEngine(StringEngine& )=delete;
|
|
|
|
StringEngine& operator = (StringEngine& )=delete;
|
|
|
|
|
|
|
|
int useLanaguage(std::string LanguageTag);
|
|
|
|
bool ready();
|
|
|
|
std::string getString(std::string Tag);
|
|
|
|
~StringEngine();
|
|
|
|
private:
|
|
|
|
struct impl;
|
|
|
|
impl* pimpl;
|
|
|
|
};
|
|
|
|
|
2017-05-22 18:47:28 +08:00
|
|
|
/// Experimental - For Experts: Use SDL ScanCode
|
|
|
|
bool GetScanKeyState(SDL_Scancode);
|
|
|
|
|
2017-02-25 09:29:34 +08:00
|
|
|
}/// End of namespace MiniEngine
|
|
|
|
|
2017-02-25 22:40:48 +08:00
|
|
|
std::string UTF8ToGBK(std::string UTF8String);
|
|
|
|
std::string GBKToUTF8(std::string GBKString);
|
2017-03-09 18:52:57 +08:00
|
|
|
bool canread(std::string Path);
|
|
|
|
bool canwrite(std::string Path);
|
|
|
|
bool isexist(std::string Path);
|
|
|
|
bool canexecute(std::string Path);
|
2017-09-26 23:02:31 +08:00
|
|
|
|
|
|
|
/// Return Value
|
|
|
|
/// true: transfer succeed. Value is outputed to _out_wstr
|
|
|
|
/// false: transfer failed. _out_wstr is not modified.
|
|
|
|
bool _ANSIToUnicode(const std::string& str,std::wstring& _out_wstr);
|
|
|
|
bool _UTF8ToUnicode(const std::string& str,std::wstring& _out_wstr);
|
|
|
|
|
|
|
|
/// Return Value
|
|
|
|
/// true: transfer succeed. Value is outputed to _out_str
|
|
|
|
/// false: transfer failed. _out_str is not modified.
|
|
|
|
bool _UnicodeToANSI(const std::wstring& wstr,std::string& _out_str);
|
|
|
|
bool _UnicodeToUTF8(const std::wstring& wstr,std::string& _out_str);
|