MCPcopy Create free account
hub / github.com/DFHack/dfhack / setClipboardTextCp437Multiline

Method setClipboardTextCp437Multiline

library/modules/DFSDL.cpp:289–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289DFHACK_EXPORT bool DFHack::setClipboardTextCp437Multiline(string text) {
290 if (!g_sdl_handle)
291 return false;
292 vector<string> lines;
293 split_string(&lines, text, "\n");
294 std::ostringstream str;
295 for (size_t idx = 0; idx < lines.size(); ++idx) {
296 str << DF2UTF(lines[idx]);
297 if (idx < lines.size() - 1) {
298#ifdef WIN32
299 str << "\r\n";
300#else
301 str << "\n";
302#endif
303 }
304 }
305 return 0 == DFHack::DFSDL::DFSDL_SetClipboardText(str.str().c_str());
306}
307
308// Queue to run callbacks on the render thread.
309// Semantics loosely based on SDL3's SDL_RunOnMainThread

Callers

nothing calls this directly

Calls 5

split_stringFunction · 0.85
DF2UTFFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected