MCPcopy Create free account
hub / github.com/WinMerge/winmerge / SaveBuffForDiff

Function SaveBuffForDiff

Src/MergeDoc.cpp:296–305  ·  view source on GitHub ↗

* @brief Save an editor text buffer to a file for prediffing (make UCS-2LE if appropriate) * * @note * original file is Ansi : * buffer -> save as Ansi -> Ansi plugins -> diffutils * original file is Unicode (UCS2-LE, UCS2-BE, UTF-8) : * buffer -> save as UTF-8 -> Unicode plugins -> convert to UTF-8 -> diffutils * (the plugins are optional, not the conversion) * @todo Show SaveToFi

Source from the content-addressed store, hash-verified

294 * @todo Show SaveToFile() errors?
295 */
296static int SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine, int nLines)
297{
298 // and we don't repack the file
299 PackingInfo tempPacker(false);
300
301 // write buffer out to temporary file
302 String sError;
303 return buf.SaveToFile(filepath, true, sError, tempPacker,
304 CRLFSTYLE::AUTOMATIC, false, nStartLine, nLines);
305}
306
307/**
308 * @brief Save files to temp files & compare again.

Callers 1

RescanMethod · 0.85

Calls 1

SaveToFileMethod · 0.45

Tested by

no test coverage detected