NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
compareFiles.cpp File Reference
#include "compareFiles.hpp"
#include "dtl/dtl.hpp"
#include <fstream>
#include <sstream>
Include dependency graph for compareFiles.cpp:

Go to the source code of this file.

Functions

static std::vector< std::string > getFileContent (const std::string &file)
 Read the content of a file in binary mode and try to detect lines within the file. More...
 
std::string compareFiles (const std::string &file1, const std::string &file2)
 Compares two files linewise and in binary mode. The differences are returned as a unified diff. More...
 

Function Documentation

◆ compareFiles()

std::string compareFiles ( const std::string &  file1,
const std::string &  file2 
)

Compares two files linewise and in binary mode. The differences are returned as a unified diff.

Parameters
file1const std::string&
file2const std::string&
Returns
std::string

Definition at line 58 of file compareFiles.cpp.

References dtl::Diff< elem, sequence, comparator >::compose(), dtl::Diff< elem, sequence, comparator >::composeUnifiedHunks(), getFileContent(), and dtl::Diff< elem, sequence, comparator >::printUnifiedFormat().

Referenced by NumeReWindow::OnCompareFiles().

Here is the call graph for this function:

◆ getFileContent()

static std::vector< std::string > getFileContent ( const std::string &  file)
static

Read the content of a file in binary mode and try to detect lines within the file.

Parameters
fileconst std::string&
Returns
std::vector<std::string>

Definition at line 32 of file compareFiles.cpp.

Referenced by compareFiles().