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

Function normalize_newlines

library/modules/DFSDL.cpp:246–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246static 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
258DFHACK_EXPORT string DFHack::getClipboardTextCp437() {
259 if (!g_sdl_handle || g_SDL_HasClipboardText() != SDL_TRUE)

Callers 2

getClipboardTextCp437Method · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected