MCPcopy Create free account
hub / github.com/comaps/comaps / MakeDiff

Function MakeDiff

libs/mwm_diff/diff.cpp:100–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98namespace mwm_diff
99{
100bool MakeDiff(std::string const & oldMwmPath, std::string const & newMwmPath, std::string const & diffPath)
101{
102 try
103 {
104 FileReader oldReader(oldMwmPath);
105 FileReader newReader(newMwmPath);
106 FileWriter diffFileWriter(diffPath);
107
108 switch (VERSION_LATEST)
109 {
110 case VERSION_V0: return MakeDiffVersion0(oldReader, newReader, diffFileWriter);
111 default: LOG(LERROR, ("Making mwm diffs with diff format version", VERSION_LATEST, "is not implemented"));
112 }
113 }
114 catch (Reader::Exception const & e)
115 {
116 LOG(LERROR, ("Could not open file when creating a patch:", e.Msg()));
117 return false;
118 }
119 catch (Writer::Exception const & e)
120 {
121 LOG(LERROR, ("Could not open file when creating a patch:", e.Msg()));
122 return false;
123 }
124
125 return false;
126}
127
128DiffApplicationResult ApplyDiff(std::string const & oldMwmPath, std::string const & newMwmPath,
129 std::string const & diffPath, base::Cancellable const & cancellable)

Callers 2

UNIT_TESTFunction · 0.85
mainFunction · 0.85

Calls 1

MakeDiffVersion0Function · 0.85

Tested by 1

UNIT_TESTFunction · 0.68