| 244 | } |
| 245 | |
| 246 | static string normalize_newlines(const string & str, bool to_spaces = false) { |
| 247 | string normalized_str = str; |
| 248 | #ifdef WIN32 |
| 249 | static const std::regex CRLF("\r\n"); |
| 250 | normalized_str = std::regex_replace(normalized_str, CRLF, "\n"); |
| 251 | #endif |
| 252 | if (to_spaces) |
| 253 | std::replace(normalized_str.begin(), normalized_str.end(), '\n', ' '); |
| 254 | |
| 255 | return normalized_str; |
| 256 | } |
| 257 | |
| 258 | DFHACK_EXPORT string DFHack::getClipboardTextCp437() { |
| 259 | if (!g_sdl_handle || g_SDL_HasClipboardText() != SDL_TRUE) |
no test coverage detected