diff --git a/MiniEngine.cpp b/MiniEngine.cpp index e2b9b17..3592dce 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -2074,6 +2074,31 @@ namespace MiniEngine delete pimpl; } + int SetClipboardText(const std::string& str) + { + return SDL_SetClipboardText(str.c_str()); + } + + std::string GetClipboardText() + { + char* pstr=SDL_GetClipboardText(); + if(pstr==nullptr) + { + return std::string(); + } + else + { + std::string s(pstr); + SDL_free(pstr); + return s; + } + } + + bool HasClipboardText() + { + return SDL_HasClipboardText()==SDL_TRUE; + } + }/// End of namespace MiniEngine /// The Following Functions are not avaliable in Visual Studio diff --git a/MiniEngine.h b/MiniEngine.h index 44338c5..6420e6d 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -650,6 +650,10 @@ namespace MiniEngine impl* pimpl; }; + int SetClipboardText(const std::string& str); + std::string GetClipboardText(); + bool HasClipboardText(); + }/// End of namespace MiniEngine std::string UTF8ToGBK(std::string UTF8String);