mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Move clipboard functions to SDLSystem
This commit is contained in:
parent
5eb66f6d0d
commit
46204ba517
|
@ -244,4 +244,33 @@ int SDLSystem::GetSystemRAM()
|
||||||
{
|
{
|
||||||
return SDL_GetSystemRAM();
|
return SDL_GetSystemRAM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
int SDLSystem::SetClipboardText(const std::string& str)
|
||||||
|
{
|
||||||
|
return SDL_SetClipboardText(str.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
std::string SDLSystem::GetClipboardText()
|
||||||
|
{
|
||||||
|
char* pstr=SDL_GetClipboardText();
|
||||||
|
if(pstr==nullptr)
|
||||||
|
{
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string s(pstr);
|
||||||
|
SDL_free(pstr);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
bool SDLSystem::HasClipboardText()
|
||||||
|
{
|
||||||
|
return SDL_HasClipboardText()==SDL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#include "end_code.h"
|
#include "end_code.h"
|
||||||
|
|
|
@ -52,6 +52,10 @@ public:
|
||||||
/// RAM is calculated in MB.
|
/// RAM is calculated in MB.
|
||||||
static int GetSystemRAM();
|
static int GetSystemRAM();
|
||||||
|
|
||||||
|
static int SetClipboardText(const std::string& str);
|
||||||
|
static std::string GetClipboardText();
|
||||||
|
static bool HasClipboardText();
|
||||||
|
|
||||||
class Android
|
class Android
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user