Horizon Official Technical Documentation
MapCache.cpp File Reference
#include "MapCache.hpp"
#include <signal.h>
#include <boost/algorithm/string.hpp>
+ Include dependency graph for MapCache.cpp:

Functions

int main (int argc, const char *argv[])
 Main Runtime Method. More...
 

Function Documentation

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Main Runtime Method.

Parameters
argc
argv
Returns
189{
190 printf(" _ _ _\n");
191 printf(" | | | | (_)\n");
192 printf(" | |_| | ___ _ __ _ _______ _ __\n");
193 printf(" | _ |/ _ \\| '__| |_ / _ \\| '_ \\\n");
194 printf(" | | | | (_) | | | |/ / (_) | | | |\n");
195 printf(" \\_| |_/\\___/|_| |_/___\\___/|_| |_|\n\n");
196 printf(" Horizon Map Cache \n\n");
197 printf("Credits: \n");
198 printf(" Smokexyz (sagunkho@hotmail.com)\n\n");
199
201
202 m.parse_exec_args(argc, argv);
203
205 return SIGABRT;
206
207 printf("Info: Config file path: '%s'\n", m.getLibrary().getMapListPath().c_str());
208 printf("Info: Compression Level '%d'\n", m.getLibrary().getCompressionLevel());
209 printf("Info: Output file set to '%s'\n", m.getLibrary().getMapCachePath().c_str());
210
212 return 1;
213
214 if (m.getLibrary().Exists()) {
215 printf("Info: Importing previously cached information from '%s'...\n", m.getLibrary().getMapCachePath().c_str());
217 }
218
219 printf("Info: Building internal cache...\n");
220
221 int new_maps = m.getLibrary().BuildInternalCache();
222 printf("Info: Internal cache has been built with %d new maps (out of %lu total).\n", new_maps,
223 m.getLibrary().getMCache()->maps.size());
224
225 printf("Info: Building external cache...\n");
227 printf("Info: Map cache has been built with %lu maps and saved to '%s'\n", m.getLibrary().getMCache()->maps.size(), m.getLibrary().getMapCachePath().c_str());
228
229 return 0;
230}
int getCompressionLevel()
Definition: MapCache.hpp:202
mcache_error_type initialize()
Definition: MapCache.cpp:146
bool BuildExternalCache()
Definition: MapCache.cpp:349
boost::filesystem::path & getMapCachePath()
Definition: MapCache.hpp:198
int BuildInternalCache()
Definition: MapCache.cpp:284
std::pair< uint8_t, grf_load_result_type > LoadGRFs()
Definition: MapCache.cpp:273
const boost::filesystem::path & getMapListPath() const
Definition: MapCache.hpp:206
std::shared_ptr< map_cache > getMCache()
Definition: MapCache.hpp:230
bool Exists()
Definition: MapCache.cpp:166
mcache_import_error_type ImportFromCacheFile()
Definition: MapCache.cpp:56
Definition: MapCache.hpp:46
Horizon::Libraries::MapCache & getLibrary()
Definition: MapCache.hpp:59
bool ParseGRFLoadResult(std::pair< uint8_t, grf_load_result_type > result)
Definition: MapCache.cpp:98
bool ParseMapCacheImportResult(mcache_import_error_type type)
Definition: MapCache.cpp:152
void parse_exec_args(int argc, const char *argv[])
Definition: MapCache.cpp:45
bool ParseInitializeResult(mcache_error_type type)
Definition: MapCache.cpp:73

References Horizon::Libraries::MapCache::BuildExternalCache(), Horizon::Libraries::MapCache::BuildInternalCache(), Horizon::Libraries::MapCache::Exists(), Horizon::Libraries::MapCache::getCompressionLevel(), Horizon::Tools::MapCache::getLibrary(), Horizon::Libraries::MapCache::getMapCachePath(), Horizon::Libraries::MapCache::getMapListPath(), Horizon::Libraries::MapCache::getMCache(), Horizon::Libraries::MapCache::ImportFromCacheFile(), Horizon::Libraries::MapCache::initialize(), Horizon::Libraries::MapCache::LoadGRFs(), Horizon::Tools::MapCache::parse_exec_args(), Horizon::Tools::MapCache::ParseGRFLoadResult(), Horizon::Tools::MapCache::ParseInitializeResult(), and Horizon::Tools::MapCache::ParseMapCacheImportResult().

+ Here is the call graph for this function: