MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetClipboardContents

Function GetClipboardContents

src/os/unix/unix.cpp:205–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204#ifndef WITH_COCOA
205std::optional<std::string> GetClipboardContents()
206{
207#ifdef WITH_SDL2
208 if (SDL_HasClipboardText() == SDL_FALSE) return std::nullopt;
209
210 char *clip = SDL_GetClipboardText();
211 if (clip != nullptr) {
212 std::string result = clip;
213 SDL_free(clip);
214 return result;
215 }
216#endif
217
218 return std::nullopt;
219}
220#endif
221
222

Callers 1

InsertClipboardMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected