From 6004794ac970138e0a3513bc39ae7aff8c162a5b Mon Sep 17 00:00:00 2001 From: DRAGONTOS Date: Tue, 8 Oct 2024 16:06:47 +0200 Subject: [PATCH] if-else: removed the else and added a mod count --- src/main.cpp | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 23103eb..b980bad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,3 @@ -#include "includes/getHttp.h" -#include "regex" #include #include #include @@ -11,6 +9,8 @@ #include #include #include +#include "includes/getHttp.h" +#include "regex" std::string woof(std::ifstream &meow) { std::ostringstream nya; @@ -40,6 +40,8 @@ int main(int argc, char **argv, char **envp) { std::string dir; dir = std::filesystem::current_path(); + int ab = 0; + // Removes cache if (std::filesystem::exists(cacheid) && std::filesystem::is_directory(cacheid)) { @@ -82,6 +84,7 @@ int main(int argc, char **argv, char **envp) { dir = ARGS[1 + 5]; } + ab = 0; try { getHttp(std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + collectionid}, &cachesc); } catch (std::string &meow) { @@ -89,7 +92,7 @@ int main(int argc, char **argv, char **envp) { return 1; } - std::cout << "success1\n"; + std::cout << "success\n"; break; } @@ -102,6 +105,7 @@ int main(int argc, char **argv, char **envp) { dir = ARGS[1 + 3]; } + ab = 0; try { getHttp(std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + collectionid}, &cachesc); } catch (std::string &meow) { @@ -135,7 +139,8 @@ int main(int argc, char **argv, char **envp) { dir = ARGS[1 + 5]; } - std::cout << "success1\n"; + ab = 1; + std::cout << "success\n"; break; } @@ -148,6 +153,7 @@ int main(int argc, char **argv, char **envp) { dir = ARGS[1 + 3]; } + ab = 1; std::cout << "success\n"; break; } else { @@ -181,12 +187,12 @@ int main(int argc, char **argv, char **envp) { std::string line; // Process each line - while (std::getline(inputFile, line)) { + while (std::getline(inputFile, line)) { // grep-like behavior (only process lines containing the pattern with two // spaces) if (std::regex_search(line, grepRegex)) { - // sed 's/">