MCPcopy Create free account
hub / github.com/ddnet/ddnet / main

Function main

src/tools/map_diff.cpp:101–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int main(int argc, const char *argv[])
102{
103 CCmdlineFix CmdlineFix(&argc, &argv);
104 std::vector<std::shared_ptr<ILogger>> vpLoggers;
105 std::shared_ptr<ILogger> pStdoutLogger = std::shared_ptr<ILogger>(log_logger_stdout());
106 if(pStdoutLogger)
107 {
108 vpLoggers.push_back(pStdoutLogger);
109 }
110 IOHANDLE LogFile = io_open("map_diff.txt", IOFLAG_WRITE);
111 if(LogFile)
112 {
113 vpLoggers.push_back(std::shared_ptr<ILogger>(log_logger_file(LogFile)));
114 }
115 log_set_global_logger(log_logger_collection(std::move(vpLoggers)).release());
116
117 if(argc != 3)
118 {
119 dbg_msg("usage", "%s map1 map2", argv[0]);
120 return -1;
121 }
122
123 std::unique_ptr<IStorage> pStorage = CreateLocalStorage();
124 if(!pStorage)
125 {
126 log_error("map_diff", "Error creating local storage");
127 return -1;
128 }
129
130 return Process(pStorage.get(), &argv[1]) ? 0 : 1;
131}

Callers

nothing calls this directly

Calls 9

log_logger_stdoutFunction · 0.85
io_openFunction · 0.85
log_logger_fileFunction · 0.85
log_set_global_loggerFunction · 0.85
log_logger_collectionFunction · 0.85
dbg_msgFunction · 0.85
CreateLocalStorageFunction · 0.85
getMethod · 0.80
ProcessFunction · 0.70

Tested by

no test coverage detected