| 98 | namespace mwm_diff |
| 99 | { |
| 100 | bool 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 | |
| 128 | DiffApplicationResult ApplyDiff(std::string const & oldMwmPath, std::string const & newMwmPath, |
| 129 | std::string const & diffPath, base::Cancellable const & cancellable) |