34 std::vector<std::string> content;
35 std::ifstream fileStream(file, std::ios_base::in | std::ios_base::binary);
37 while (fileStream.good() && !fileStream.eof())
40 std::getline(fileStream, sLine);
41 content.push_back(sLine);
58std::string
compareFiles(
const std::string& file1,
const std::string& file2)
71 std::ostringstream uniDiff;
74 uniDiff <<
"--- " << file1 <<
"\n+++ " << file2 <<
"\n";
void printUnifiedFormat(stream &out) const
void composeUnifiedHunks()
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.
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.