mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 13:27:57 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
7
generator/mwm_diff/mwm_diff_tool/CMakeLists.txt
Normal file
7
generator/mwm_diff/mwm_diff_tool/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
project(mwm_diff_tool)
|
||||
|
||||
set(SRC mwm_diff_tool.cpp)
|
||||
|
||||
omim_add_executable(${PROJECT_NAME} ${SRC})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} mwm_diff)
|
||||
46
generator/mwm_diff/mwm_diff_tool/mwm_diff_tool.cpp
Normal file
46
generator/mwm_diff/mwm_diff_tool/mwm_diff_tool.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "generator/mwm_diff/diff.hpp"
|
||||
|
||||
#include "base/cancellable.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
auto const ShowUsage = [argv]()
|
||||
{
|
||||
std::cout <<
|
||||
"Usage: " << argv[0] << " make|apply olderMWMPath newerMWMPath diffPath\n"
|
||||
"make\n"
|
||||
" Creates the diff between newer and older MWMs at `diffPath`\n"
|
||||
"apply\n"
|
||||
" Applies the diff at `diffPath` to the mwm at `olderMWMPath` and stores result at `newerMWMPath`.\n"
|
||||
"WARNING: THERE IS NO MWM VALIDITY CHECK!\n";
|
||||
};
|
||||
|
||||
if (argc < 5)
|
||||
{
|
||||
ShowUsage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto const IsEqualUsage = [argv](char const * s) { return 0 == std::strcmp(argv[1], s); };
|
||||
char const * olderMWMPath{argv[2]}, * newerMWMPath{argv[3]}, * diffPath{argv[4]};
|
||||
|
||||
if (IsEqualUsage("make"))
|
||||
{
|
||||
if (generator::mwm_diff::MakeDiff(olderMWMPath, newerMWMPath, diffPath))
|
||||
return 0;
|
||||
}
|
||||
else if (IsEqualUsage("apply"))
|
||||
{
|
||||
base::Cancellable cancellable;
|
||||
auto const res = generator::mwm_diff::ApplyDiff(olderMWMPath, newerMWMPath, diffPath, cancellable);
|
||||
if (res == generator::mwm_diff::DiffApplicationResult::Ok)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
ShowUsage();
|
||||
|
||||
return -1; // Failed, Cancelled.
|
||||
}
|
||||
Reference in New Issue
Block a user