From ea5df8bc1c03c51a3e9e2408855811ac1045e399 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 25 Dec 2022 22:52:25 +0100 Subject: update makefile and add generated class diagram --- oop2eindopdr/class-diagram.svg | 3690 ++++++++++++++++++++++++++++++++++++++++ oop2eindopdr/makefile | 2 + 2 files changed, 3692 insertions(+) create mode 100644 oop2eindopdr/class-diagram.svg (limited to 'oop2eindopdr') diff --git a/oop2eindopdr/class-diagram.svg b/oop2eindopdr/class-diagram.svg new file mode 100644 index 0000000..4467582 --- /dev/null +++ b/oop2eindopdr/class-diagram.svg @@ -0,0 +1,3690 @@ + + +Qt SVG Document +Generated with Qt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ZipExport + + + + + + + + + + + + + + + + + + + + + + + + + +- pokedex : Pokedex* + + + + + + + + + + + + + + + + + + +- csv_path : string + + + + + + + + + + + + + + + + + + +- zip_path : string + + + + + + + + + + + + + + + + + + +- id_list : std::vector< std :: string > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ ZipExport() «constructor» + + + + + + + + + + + + + + + + + + ++ ZipExport(pokedex : Pokedex*, input_csv : string, output_zip : string) «constructor» + + + + + + + + + + + + + + + + + + ++ ~ZipExport() «destructor» + + + + + + + + + + + + + + + + + + ++ set_pokedex(pokedex : Pokedex*) + + + + + + + + + + + + + + + + + + ++ import_csv(filename : string) + + + + + + + + + + + + + + + + + + ++ export_zip(filename : string) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Pokedex + + + + + + + + + + + + + + + + + + + + + + + + + +- cards : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + +- cache : CacheManager* + + + + + + + + + + + + + + + + + + +- api : PokemonTCGAPIClient* + + + + + + + + + + + + + + + + + + +- download_manager : DownloadManager* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- load_collection_remote() + + + + + + + + + + + + + + + + + + +- load_collection_local() + + + + + + + + + + + + + + + + + + +- verify_collection() + + + + + + + + + + + + + + + + + + +- search_cards_local(query : string) : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + +- search_cards_remote(query : string) : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + +- lower(input : string) : string + + + + + + + + + + + + + + + + + + ++ Pokedex() «constructor» + + + + + + + + + + + + + + + + + + ++ ~Pokedex() «destructor» + + + + + + + + + + + + + + + + + + ++ search_cards(query : string) : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + ++ get_card_by_id(id : string) : PokemonCard* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +DownloadManager + + + + + + + + + + + + + + + + + + + + + + + + + +- max_files : const unsigned + + + + + + + + + + + + + + + + + + +- download_queue : std::vector< std :: thread * > + + + + + + + + + + + + + + + + + + +- file_queue : std::vector< std :: fstream * > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- open_file(filename : string) : std::fstream* + + + + + + + + + + + + + + + + + + +- close_file(file_ptr : std::fstream*) + + + + + + + + + + + + + + + + + + ++ DownloadManager() «constructor» + + + + + + + + + + + + + + + + + + ++ ~DownloadManager() «destructor» + + + + + + + + + + + + + + + + + + ++ wget(url : string, filename : string) : std::thread* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0..1 + + + + + + + + + + + + +-pokedex + + + + + + + + + + + + +0..1 + + + + + + + + + + + + +0..1 + + + + + + + + + + + + +-pokedex + + + + + + + + + + + + + + + + + + + +CacheManager + + + + + + + + + + + + + + + + + + + + + + + + + +- cache_path : string + + + + + + + + + + + + + + + + + + +- files : std::vector< std :: fstream * > + + + + + + + + + + + + + + + + + + +- max_tries : const unsigned int + + + + + + + + + + + + + + + + + + ++ age : uint64_t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- retry(label : string, check_pre : bool, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + + + + + + + + + + + + + + + + + + +- retry_while(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + + + + + + + + + + + + + + + + + + +- retry_if(label : string, action : std::function< void ( ) >, retry_if : std::function< bool ( ) >) + + + + + + + + + + + + + + + + + + ++ CacheManager(cache_path : string) «constructor» + + + + + + + + + + + + + + + + + + ++ CacheManager(cache_path : const char*) «constructor» + + + + + + + + + + + + + + + + + + ++ ~CacheManager() «destructor» + + + + + + + + + + + + + + + + + + ++ init_cache() + + + + + + + + + + + + + + + + + + ++ update_cache() + + + + + + + + + + + + + + + + + + ++ verify_cache() + + + + + + + + + + + + + + + + + + ++ cache_get(filename : const char*) : std::fstream* + + + + + + + + + + + + + + + + + + ++ cache_get(filename : string) : std::fstream* + + + + + + + + + + + + + + + + + + ++ cache_exists(filename : const char*) : bool + + + + + + + + + + + + + + + + + + ++ cache_exists(filename : string) : bool + + + + + + + + + + + + + + + + + + ++ prefix_cache_path(filename : const char*) : string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-cache + + + + + + + + + + + + + + + + + + + +PokemonTCGAPIClient + + + + + + + + + + + + + + + + + + + + + + + + + +- API_URL : const char* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ PokemonTCGAPIClient() «constructor» + + + + + + + + + + + + + + + + + + ++ ~PokemonTCGAPIClient() «destructor» + + + + + + + + + + + + + + + + + + +- raw_request(endpoint : const char*, params : cpr::Parameters) : nlohmann::json + + + + + + + + + + + + + + + + + + +- raw_get_cards(query : const char*) : nlohmann::json + + + + + + + + + + + + + + + + + + +- raw_get_card(id : const char*) : nlohmann::json + + + + + + + + + + + + + + + + + + +- raw_get_sets(query : const char*) : nlohmann::json + + + + + + + + + + + + + + + + + + ++ get_cards_by_query(query : const char*) : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + ++ get_set_cards(set_name : const char*) : std::vector< PokemonCard * > + + + + + + + + + + + + + + + + + + ++ get_full_card(id : const char*) : PokemonCard* + + + + + + + + + + + + + + + + + + ++ get_sets() : std::vector< std :: string > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PokemonCard + + + + + + + + + + + + + + + + + + + + + + + + + +- raw_data : nlohmann::json + + + + + + + + + + + + + + + + + + +- pokedex : Pokedex* + + + + + + + + + + + + + + + + + + +- image_download_thread : std::thread* + + + + + + + + + + + + + + + + + + +- url_card_normal : string + + + + + + + + + + + + + + + + + + +- url_card_hires : string + + + + + + + + + + + + + + + + + + ++ id : string + + + + + + + + + + + + + + + + + + ++ name : string + + + + + + + + + + + + + + + + + + ++ hp : unsigned + + + + + + + + + + + + + + + + + + ++ value : double + + + + + + + + + + + + + + + + + + ++ attacks : std::vector< std :: string > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- raw_load_json(raw_data : nlohmann::json) + + + + + + + + + + + + + + + + + + +- raw_load_cache(cache_path : const char*) + + + + + + + + + + + + + + + + + + +- prefix_cache_path(filename : const char*) : string + + + + + + + + + + + + + + + + + + ++ PokemonCard(pokedex : Pokedex*) «constructor» + + + + + + + + + + + + + + + + + + ++ ~PokemonCard() «destructor» + + + + + + + + + + + + + + + + + + ++ short_identifier() : string + + + + + + + + + + + + + + + + + + ++ fetch_market_value() + + + + + + + + + + + + + + + + + + ++ verify_files() + + + + + + + + + + + + + + + + + + ++ download_files() + + + + + + + + + + + + + + + + + + ++ set_pokedex(pokedex : Pokedex*) + + + + + + + + + + + + + + + + + + ++ image_location() : string + + + + + + + + + + + + + + + + + + ++ image_location_hires() : string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0..1 + + + + + + + + + + + + +-api + + + + + + + + + diff --git a/oop2eindopdr/makefile b/oop2eindopdr/makefile index 7ad0415..104bd94 100644 --- a/oop2eindopdr/makefile +++ b/oop2eindopdr/makefile @@ -11,6 +11,8 @@ LFLAGS += -lstdc++ -lcpr -lzip SRCS := $(wildcard *.cpp) OBJS := $(patsubst %.cpp,%.o, $(SRCS)) +.PHONY: clean compile_commands zip + all: $(TARGET) %.o: %.cpp -- cgit v1.2.3