From 2455528d8f35ac6203dfd8b6b6d78fa275c4c33d Mon Sep 17 00:00:00 2001 From: Lateralus138 <faithnomoread@yahoo.com> Date: Wed, 6 Mar 2024 11:47:21 -0600 Subject: [PATCH] New Pre-release test for v2 - 17:47 Saturday, March 6, 2024 Universal Time Coordinated --- .github/workflows/main_build.yml | 20 +- README.md | 6 +- docs/md/pre-release.md | 6 +- docs/md/release.md | 8 +- hostscompress/ArgumentParser.cpp | 76 ++--- hostscompress/ArgumentParser.h | 26 +- hostscompress/Bench.cpp | 240 +++++++------- hostscompress/Bench.h | 58 ++-- hostscompress/Console.cpp | 156 --------- hostscompress/Console.h | 66 ---- hostscompress/Functions.cpp | 28 +- hostscompress/Functions.h | 2 +- hostscompress/ProgramError.cpp | 144 ++++----- hostscompress/ProgramError.h | 66 ++-- hostscompress/Resource.aps | Bin 67516 -> 67528 bytes hostscompress/Resource.rc | Bin 5328 -> 5328 bytes hostscompress/hostscompress.cpp | 83 +---- hostscompress/hostscompress.vcxproj | 342 ++++++++++---------- hostscompress/hostscompress.vcxproj.filters | 126 ++++---- hostscompress/hostscompress.vcxproj.user | 6 +- hostscompress/pch.h | 36 +-- hostscompress/resource.h | 32 +- 22 files changed, 612 insertions(+), 915 deletions(-) delete mode 100644 hostscompress/Console.cpp delete mode 100644 hostscompress/Console.h diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index fdf2b7d..a342ac2 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -2,23 +2,21 @@ name: Main Build on: push: paths: - - '**.cpp' - - '**.h' - - '**.o' + - 'hostscompress/**.cpp' + - 'hostscompress/**.h' - '**.sln' - - '**.yml' - - '*.yml' - - '**.ps1' + - '.github/workflows/**.yml' + - 'scripts/**.ps1' env: - VS_PROGRAM: 1 - VS_FILE: 1 - VS_BUGFIX: 1 + VS_PROGRAM: 2 + VS_FILE: 0 + VS_BUGFIX: 0 VS_EPOCH: VS_FULL: RELEASE_TITLE: "Hosts Compress" - RELEASE_FILE: "./docs/md/release.md" + RELEASE_FILE: "./docs/md/pre-release.md" BIN_DEFAULT: "hostscompress" - PRERELEASE: False + PRERELEASE: True jobs: build_windows: name: Build Windows Project diff --git a/README.md b/README.md index 8e504a8..1aac645 100644 --- a/README.md +++ b/README.md @@ -236,10 +236,12 @@ Compressed data has been successfully written to: - 1.0.0.0 - Initial release. - 1.1.0.0 - Fixed regular expression match for URLs that begin with `0\.0\.0\.0\..*` and `127\.0\.0\.1\..*` while still keeping `0.0.0.0 0.0.0.0` and `127.0.0.1 127.0.0.1`. - 1.1.1.0 - Bug fix for last entry not being prepended with the correct IP address as reported in issue: [Missing 0.0.0.0 in front of the last line in the output file #1](https://github.com/Lateralus138/hosts-compress-windows/issues/1). + - 2.0.0.0 - Complete removal of progress bar and any console mode code and therefore considered a completely different version. + - Progress bar removed because this program is lightning fast even for large files. There's no need for it. + - Console mode removed because it no longer works well in modern Windows/CMD. I can't imagine a reason for people to be using CMD in this day and age anyway and I no longer feel compelled to cater to it. Having said that, I do still plan to look into possibilities in the future, but it's not a priority. #### Coming Updates - - 1.1.2.0 - Possible fix for code page not being set properly. This may just be removed for version 2. - - 1.2.0.0 - Possible plan to replace inline progress bar with a new class module I wrote. Cosmetic only with a slight, but humanly unnoticeable performance increase. If removed in a possible 1.1.2.0 version then this will not be necessary. + - 2.1.0.0 - I will possibly be looking into proper display usage for console mode in modern CMD. This is not a priority and no promise for a time line. ### Source File Quality diff --git a/docs/md/pre-release.md b/docs/md/pre-release.md index 97fd591..d377914 100644 --- a/docs/md/pre-release.md +++ b/docs/md/pre-release.md @@ -9,10 +9,12 @@ - 1.0.0.0 - Initial release. - 1.1.0.0 - Fixed regular expression match for URLs that begin with `0\.0\.0\.0\..*` and `127\.0\.0\.1\..*` while still keeping `0.0.0.0 0.0.0.0` and `127.0.0.1 127.0.0.1`. - 1.1.1.0 - Bug fix for last entry not being prepended with the correct IP address as reported in issue: [Missing 0.0.0.0 in front of the last line in the output file #1](https://github.com/Lateralus138/hosts-compress-windows/issues/1). + - 2.0.0.0 - Complete removal of progress bar and any console mode code and therefore considered a completely different version. + - Progress bar removed because this program is lightning fast even for large files. There's no need for it. + - Console mode removed because it no longer works well in modern Windows/CMD. I can't imagine a reason for people to be using CMD in this day and age anyway and I no longer feel compelled to cater to it. Having said that, I do still plan to look into possibilities in the future, but it's not a priority. #### Coming Updates - - 1.1.2.0 - Possible fix for code page not being set properly. This may just be removed for version 2. - - 1.2.0.0 - Possible plan to replace inline progress bar with a new class module I wrote. Cosmetic only with a slight, but humanly unnoticeable performance increase. If removed in a possible 1.1.2.0 version then this will not be necessary. + - 2.1.0.0 - I will possibly be looking into proper display usage for console mode in modern CMD. This is not a priority and no promise for a time line. --- diff --git a/docs/md/release.md b/docs/md/release.md index 22e523e..d377914 100644 --- a/docs/md/release.md +++ b/docs/md/release.md @@ -1,4 +1,4 @@ -# Hosts Compress - [hostscompress] +# Hosts Compress - [hostscompress] (Pre-release) ![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=Lateralus138&repo=hosts-compress-windows) @@ -9,10 +9,12 @@ - 1.0.0.0 - Initial release. - 1.1.0.0 - Fixed regular expression match for URLs that begin with `0\.0\.0\.0\..*` and `127\.0\.0\.1\..*` while still keeping `0.0.0.0 0.0.0.0` and `127.0.0.1 127.0.0.1`. - 1.1.1.0 - Bug fix for last entry not being prepended with the correct IP address as reported in issue: [Missing 0.0.0.0 in front of the last line in the output file #1](https://github.com/Lateralus138/hosts-compress-windows/issues/1). + - 2.0.0.0 - Complete removal of progress bar and any console mode code and therefore considered a completely different version. + - Progress bar removed because this program is lightning fast even for large files. There's no need for it. + - Console mode removed because it no longer works well in modern Windows/CMD. I can't imagine a reason for people to be using CMD in this day and age anyway and I no longer feel compelled to cater to it. Having said that, I do still plan to look into possibilities in the future, but it's not a priority. #### Coming Updates - - 1.1.2.0 - Possible fix for code page not being set properly. This may just be removed for version 2. - - 1.2.0.0 - Possible plan to replace inline progress bar with a new class module I wrote. Cosmetic only with a slight, but humanly unnoticeable performance increase. If removed in a possible 1.1.2.0 version then this will not be necessary. + - 2.1.0.0 - I will possibly be looking into proper display usage for console mode in modern CMD. This is not a priority and no promise for a time line. --- diff --git a/hostscompress/ArgumentParser.cpp b/hostscompress/ArgumentParser.cpp index 4897957..b25fa8f 100644 --- a/hostscompress/ArgumentParser.cpp +++ b/hostscompress/ArgumentParser.cpp @@ -1,39 +1,39 @@ -#include "pch.h" -#include "ArgumentParser.h" -ArgumentParser::ArgumentParser(int& argc, const char** argv, int start) -{ - this->tokens = std::vector<std::string>(argv + start, argv + argc); -} -bool ArgumentParser::optionExists(const std::string& option) const -{ - return (std::find(this->tokens.begin(), this->tokens.end(), option) != this->tokens.end()); -} -bool ArgumentParser::optionsExist(const std::vector<std::string>& options) const -{ - for (std::vector<std::string>::const_iterator iter = options.begin(); iter < options.end(); iter++) - { - if (this->optionExists(*iter)) return true; - } - return false; -} -const std::string& ArgumentParser::getOption(const std::string& option) const -{ - std::vector<std::string>::const_iterator iterator; - iterator = std::find(this->tokens.begin(), this->tokens.end(), option); - if ((iterator != this->tokens.end()) && (++iterator != this->tokens.end())) - { - return *iterator; - } - static const std::string empty(""); - return empty; -} -const std::string& ArgumentParser::getOptions(const std::vector<std::string>& options) const -{ - for (std::vector<std::string>::const_iterator iter = options.begin(); iter < options.end(); iter++) - { - const std::string &arg = this->getOption(*iter); - if (!arg.empty()) return arg; - } - static const std::string empty(""); - return empty; +#include "pch.h" +#include "ArgumentParser.h" +ArgumentParser::ArgumentParser(int& argc, const char** argv, int start) +{ + this->tokens = std::vector<std::string>(argv + start, argv + argc); +} +bool ArgumentParser::optionExists(const std::string& option) const +{ + return (std::find(this->tokens.begin(), this->tokens.end(), option) != this->tokens.end()); +} +bool ArgumentParser::optionsExist(const std::vector<std::string>& options) const +{ + for (std::vector<std::string>::const_iterator iter = options.begin(); iter < options.end(); iter++) + { + if (this->optionExists(*iter)) return true; + } + return false; +} +const std::string& ArgumentParser::getOption(const std::string& option) const +{ + std::vector<std::string>::const_iterator iterator; + iterator = std::find(this->tokens.begin(), this->tokens.end(), option); + if ((iterator != this->tokens.end()) && (++iterator != this->tokens.end())) + { + return *iterator; + } + static const std::string empty(""); + return empty; +} +const std::string& ArgumentParser::getOptions(const std::vector<std::string>& options) const +{ + for (std::vector<std::string>::const_iterator iter = options.begin(); iter < options.end(); iter++) + { + const std::string &arg = this->getOption(*iter); + if (!arg.empty()) return arg; + } + static const std::string empty(""); + return empty; } \ No newline at end of file diff --git a/hostscompress/ArgumentParser.h b/hostscompress/ArgumentParser.h index 3345e21..04fcdeb 100644 --- a/hostscompress/ArgumentParser.h +++ b/hostscompress/ArgumentParser.h @@ -1,13 +1,13 @@ -#pragma once -class ArgumentParser -{ -private: - std::vector<std::string> tokens; -public: - ArgumentParser(int& argc, const char** argv, int start); - bool optionExists(const std::string& option) const; - bool optionsExist(const std::vector<std::string>& options) const; - const std::string& getOption(const std::string& option) const; - const std::string& getOptions(const std::vector<std::string>& options) const; -}; - +#pragma once +class ArgumentParser +{ +private: + std::vector<std::string> tokens; +public: + ArgumentParser(int& argc, const char** argv, int start); + bool optionExists(const std::string& option) const; + bool optionsExist(const std::vector<std::string>& options) const; + const std::string& getOption(const std::string& option) const; + const std::string& getOptions(const std::vector<std::string>& options) const; +}; + diff --git a/hostscompress/Bench.cpp b/hostscompress/Bench.cpp index 300d63a..2256bda 100644 --- a/hostscompress/Bench.cpp +++ b/hostscompress/Bench.cpp @@ -1,121 +1,121 @@ -#include "Bench.h" -#include "pch.h" -#include <io.h> -#include <iostream> -#include <iomanip> -#include <sstream> -void Bench::_Begin() -{ - Bench::begin = std::chrono::high_resolution_clock::now(); -} -void Bench::_End() -{ - std::chrono::time_point<struct std::chrono::steady_clock, - class std::chrono::duration<__int64, struct std::ratio<1, 1000000000>>> end = - std::chrono::high_resolution_clock::now(); - if (Bench::begin.time_since_epoch().count() > 0) - { - Bench::elapse = - { - std::chrono::duration_cast<std::chrono::microseconds> (end - Bench::begin).count(), - std::chrono::duration_cast<std::chrono::milliseconds> (end - Bench::begin).count(), - std::chrono::duration_cast<std::chrono::seconds> (end - Bench::begin).count() - }; - Bench::time_logger.push_back(Bench::elapse); - Bench::microd_logger.push_back(Bench::elapse.Microseconds); - Bench::millid_logger.push_back(Bench::elapse.Milliseconds); - Bench::second_logger.push_back(Bench::elapse.Seconds); - } -} -void Bench::_PrintElapseMessage() -{ - std::cout << formatElapsedMessage() << std::flush; -} -std::string Bench::formatElapsedMessage() -{ - int64_t mcs = Bench::elapse.Microseconds; - int64_t mls = Bench::elapse.Milliseconds; - int64_t sec = Bench::elapse.Seconds; - std::vector<int64_t> microd_logger_v = Bench::microd_logger; - std::vector<int64_t> millid_logger_v = Bench::millid_logger; - std::vector<int64_t> second_logger_v = Bench::second_logger; - int64_t total_micro = [microd_logger_v]() - { - int64_t total = 0; - for (int64_t value : microd_logger_v) - { - total += value; - } - return total; - }(); - int64_t total_milli = [millid_logger_v]() - { - int64_t total = 0; - for (int64_t value : millid_logger_v) - { - total += value; - } - return total; - }(); - int64_t total_second = [second_logger_v]() - { - int64_t total = 0; - for (int64_t value : second_logger_v) - { - total += value; - } - return total; - }(); - std::string total_micro_str = std::to_string(total_micro); - long double total_micro_average = static_cast<long double>(static_cast<long double>(total_micro) / static_cast<long double>(microd_logger_v.size())); - std::string total_micro_average_str = std::to_string(total_micro_average); - std::string total_milli_str = std::to_string(total_milli); - long double total_milli_average = static_cast<long double>(static_cast<long double>(total_milli) / static_cast<long double>(microd_logger_v.size())); - std::string total_milli_average_str = std::to_string(total_milli_average); - std::string total_secon_str = std::to_string(total_second); - long double total_secon_average = static_cast<long double>(static_cast<long double>(total_second) / static_cast<long double>(microd_logger_v.size())); - std::string total_secon_average_str = std::to_string(total_secon_average); - std::stringstream ss; - ss << std::setw(20) << std::setfill(' ') << mcs; - std::string mc = ss.str(); - ss.str(std::string()); - ss << std::setw(20) << std::setfill(' ') << mls; - std::string ml = ss.str(); - ss.str(std::string()); - ss << std::setw(20) << std::setfill(' ') << sec; - std::string se = ss.str(); - ss.str(std::string()); - ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_micro_average; - total_micro_average_str = ss.str(); - ss.str(std::string()); - ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_milli_average; - total_milli_average_str = ss.str(); - ss.str(std::string()); - ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_secon_average; - total_secon_average_str = ss.str(); - ss.str(std::string()); - ss << Bench::microd_logger.size(); - std::string microd_size = ss.str(); - std::string message = "Bench duration: "; - message.append(microd_size); - message.append(" iterations\nMicroseconds:\t["); - message.append(mc); - message.append("µs]/["); - message.append(total_micro_str); - message.append("]\nAverage:\t["); - message.append(total_micro_average_str); - message.append("µs]\nMilliseconds:\t["); - message.append(ml); - message.append("ms]/["); - message.append(total_milli_str); - message.append("]\nAverage:\t["); - message.append(total_milli_average_str); - message.append("ms]\nSeconds:\t["); - message.append(se); - message.append("s ]/["); - message.append(total_secon_str); - message.append("]\nAverage:\t["); - message.append(total_secon_average_str); - message.append("s ]\n"); - return message; +#include "Bench.h" +#include "pch.h" +#include <io.h> +#include <iostream> +#include <iomanip> +#include <sstream> +void Bench::_Begin() +{ + Bench::begin = std::chrono::high_resolution_clock::now(); +} +void Bench::_End() +{ + std::chrono::time_point<struct std::chrono::steady_clock, + class std::chrono::duration<__int64, struct std::ratio<1, 1000000000>>> end = + std::chrono::high_resolution_clock::now(); + if (Bench::begin.time_since_epoch().count() > 0) + { + Bench::elapse = + { + std::chrono::duration_cast<std::chrono::microseconds> (end - Bench::begin).count(), + std::chrono::duration_cast<std::chrono::milliseconds> (end - Bench::begin).count(), + std::chrono::duration_cast<std::chrono::seconds> (end - Bench::begin).count() + }; + Bench::time_logger.push_back(Bench::elapse); + Bench::microd_logger.push_back(Bench::elapse.Microseconds); + Bench::millid_logger.push_back(Bench::elapse.Milliseconds); + Bench::second_logger.push_back(Bench::elapse.Seconds); + } +} +void Bench::_PrintElapseMessage() +{ + std::cout << formatElapsedMessage() << std::flush; +} +std::string Bench::formatElapsedMessage() +{ + int64_t mcs = Bench::elapse.Microseconds; + int64_t mls = Bench::elapse.Milliseconds; + int64_t sec = Bench::elapse.Seconds; + std::vector<int64_t> microd_logger_v = Bench::microd_logger; + std::vector<int64_t> millid_logger_v = Bench::millid_logger; + std::vector<int64_t> second_logger_v = Bench::second_logger; + int64_t total_micro = [microd_logger_v]() + { + int64_t total = 0; + for (int64_t value : microd_logger_v) + { + total += value; + } + return total; + }(); + int64_t total_milli = [millid_logger_v]() + { + int64_t total = 0; + for (int64_t value : millid_logger_v) + { + total += value; + } + return total; + }(); + int64_t total_second = [second_logger_v]() + { + int64_t total = 0; + for (int64_t value : second_logger_v) + { + total += value; + } + return total; + }(); + std::string total_micro_str = std::to_string(total_micro); + long double total_micro_average = static_cast<long double>(static_cast<long double>(total_micro) / static_cast<long double>(microd_logger_v.size())); + std::string total_micro_average_str = std::to_string(total_micro_average); + std::string total_milli_str = std::to_string(total_milli); + long double total_milli_average = static_cast<long double>(static_cast<long double>(total_milli) / static_cast<long double>(microd_logger_v.size())); + std::string total_milli_average_str = std::to_string(total_milli_average); + std::string total_secon_str = std::to_string(total_second); + long double total_secon_average = static_cast<long double>(static_cast<long double>(total_second) / static_cast<long double>(microd_logger_v.size())); + std::string total_secon_average_str = std::to_string(total_secon_average); + std::stringstream ss; + ss << std::setw(20) << std::setfill(' ') << mcs; + std::string mc = ss.str(); + ss.str(std::string()); + ss << std::setw(20) << std::setfill(' ') << mls; + std::string ml = ss.str(); + ss.str(std::string()); + ss << std::setw(20) << std::setfill(' ') << sec; + std::string se = ss.str(); + ss.str(std::string()); + ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_micro_average; + total_micro_average_str = ss.str(); + ss.str(std::string()); + ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_milli_average; + total_milli_average_str = ss.str(); + ss.str(std::string()); + ss << std::setw(20) << std::setfill(' ') << std::setprecision(4) << total_secon_average; + total_secon_average_str = ss.str(); + ss.str(std::string()); + ss << Bench::microd_logger.size(); + std::string microd_size = ss.str(); + std::string message = "Bench duration: "; + message.append(microd_size); + message.append(" iterations\nMicroseconds:\t["); + message.append(mc); + message.append("µs]/["); + message.append(total_micro_str); + message.append("]\nAverage:\t["); + message.append(total_micro_average_str); + message.append("µs]\nMilliseconds:\t["); + message.append(ml); + message.append("ms]/["); + message.append(total_milli_str); + message.append("]\nAverage:\t["); + message.append(total_milli_average_str); + message.append("ms]\nSeconds:\t["); + message.append(se); + message.append("s ]/["); + message.append(total_secon_str); + message.append("]\nAverage:\t["); + message.append(total_secon_average_str); + message.append("s ]\n"); + return message; } \ No newline at end of file diff --git a/hostscompress/Bench.h b/hostscompress/Bench.h index 9000a9d..3bcfcea 100644 --- a/hostscompress/Bench.h +++ b/hostscompress/Bench.h @@ -1,29 +1,29 @@ -#ifndef BENCH_H -#define BENCH_H -#include <chrono> -#include <string> -#include <vector> - -struct Time -{ - int64_t Microseconds; - int64_t Milliseconds; - int64_t Seconds; -}; -class Bench -{ -private: - std::chrono::time_point<struct std::chrono::steady_clock, - class std::chrono::duration<__int64, struct std::ratio<1, 1000000000>>> begin; - Time elapse = { 0 }; - std::vector<Time> time_logger; - std::vector<int64_t> microd_logger; - std::vector<int64_t> millid_logger; - std::vector<int64_t> second_logger; -public: - void _Begin(); - void _End(); - void _PrintElapseMessage(); - std::string formatElapsedMessage(); - }; -#endif // !BENCH_H +#ifndef BENCH_H +#define BENCH_H +#include <chrono> +#include <string> +#include <vector> + +struct Time +{ + int64_t Microseconds; + int64_t Milliseconds; + int64_t Seconds; +}; +class Bench +{ +private: + std::chrono::time_point<struct std::chrono::steady_clock, + class std::chrono::duration<__int64, struct std::ratio<1, 1000000000>>> begin; + Time elapse = { 0 }; + std::vector<Time> time_logger; + std::vector<int64_t> microd_logger; + std::vector<int64_t> millid_logger; + std::vector<int64_t> second_logger; +public: + void _Begin(); + void _End(); + void _PrintElapseMessage(); + std::string formatElapsedMessage(); + }; +#endif // !BENCH_H diff --git a/hostscompress/Console.cpp b/hostscompress/Console.cpp deleted file mode 100644 index e60a18c..0000000 --- a/hostscompress/Console.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "pch.h" -#include "Console.h" -// CodePage -void CodePage::setInitCodePage(ProgramError& perror, int errorValue, std::string errorMessage) -{ - if (initCodePage == 0) - { - getCodePage(perror, errorValue, errorMessage); - initCodePage = currentCodePage; - } -} -unsigned int CodePage::getInitCodePage() -{ - return initCodePage; -} -void CodePage::getCodePage(ProgramError& perror, int errorValue, std::string errorMessage) -{ - const unsigned int CP = GetConsoleCP(); - if (CP == 0) - { - SetCustomError(perror, errorValue, errorMessage); - } - currentCodePage = CP; -} -unsigned int CodePage::getCurrentCodePage() -{ - return currentCodePage; -} -void CodePage::setCodePage(unsigned int codePage, ProgramError& perror, int errorValue, std::string errorMessage) -{ - const bool SET = SetConsoleCP(codePage); - if (!SET) - { - SetCustomError(perror, errorValue, errorMessage); - } - else - { - currentCodePage = codePage; - } -} -void CodePage::setInitOutputCodePage(ProgramError& perror, int errorValue, std::string errorMessage) -{ - if (initOutputCodePage == 0) - { - getOutputCodePage(perror, errorValue, errorMessage); - initOutputCodePage = currentOutputCodePage; - } -} -unsigned int CodePage::getInitOutputCodePage() -{ - return initOutputCodePage; -} -void CodePage::getOutputCodePage(ProgramError& perror, int errorValue, std::string errorMessage) -{ - const unsigned int CP = GetConsoleOutputCP(); - if (CP == 0) - { - SetCustomError(perror, errorValue, errorMessage); - } - currentOutputCodePage = CP; -} -unsigned int CodePage::getCurrentOutputCodePage() -{ - return currentOutputCodePage; -} -void CodePage::setOutputCodePage(unsigned int outputCodePage, ProgramError& perror, int errorValue, std::string errorMessage) -{ - const bool SET = SetConsoleOutputCP(outputCodePage); - if (!SET) - { - SetCustomError(perror, errorValue, errorMessage); - } - else - { - currentOutputCodePage = outputCodePage; - } -} -// Handle -void Handle::setInputHandle(ProgramError& perror, int errorValue, std::string errorMessage) -{ - inputHandle = GetStdHandle(STD_INPUT_HANDLE); - if (inputHandle == INVALID_HANDLE_VALUE) - { - SetCustomError(perror, errorValue, errorMessage); - } -} -void Handle::setOutputHandle(ProgramError& perror, int errorValue, std::string errorMessage) -{ - outputHandle = GetStdHandle(STD_OUTPUT_HANDLE); - if (outputHandle == INVALID_HANDLE_VALUE) - { - SetCustomError(perror, errorValue, errorMessage); - } -} -void Handle::setErrorHandle(ProgramError& perror, int errorValue, std::string errorMessage) -{ - errorHandle = GetStdHandle(STD_ERROR_HANDLE); - if (errorHandle == INVALID_HANDLE_VALUE) - { - SetCustomError(perror, errorValue, errorMessage); - } -} -HANDLE Handle::getInputHandle() -{ - return inputHandle; -} -HANDLE Handle::getOutputHandle() -{ - return outputHandle; -} -HANDLE Handle::getErrorHandle() -{ - return errorHandle; -} -// ConsoleMode -void ConsoleMode::setInitConsoleMode(HANDLE handle, ProgramError& perror, int errorValue, std::string errorMessage) -{ - if (initConsoleMode == 0) - { - getConsoleMode(handle, perror, errorValue, errorMessage); - initConsoleMode = currentConsoleMode; - } -} -unsigned int ConsoleMode::getInitConsoleMode() -{ - return initConsoleMode; -} -void ConsoleMode::getConsoleMode(HANDLE handle, ProgramError& perror, int errorValue, std::string errorMessage) -{ - DWORD buffer = { 0 }; - const bool GET = GetConsoleMode(handle, &buffer); - if (!GET) - { - SetCustomError(perror, errorValue, errorMessage); - } - else - { - currentConsoleMode = buffer; - } -} -unsigned int ConsoleMode::getCurrentConsoleMode() -{ - return currentConsoleMode; -} -void ConsoleMode::setConsoleMode(HANDLE handle, unsigned int consoleMode, ProgramError& perror, int errorValue, std::string errorMessage) -{ - bool SET = SetConsoleMode(handle, consoleMode); - if (!SET) - { - SetCustomError(perror, errorValue, errorMessage); - } - else - { - currentConsoleMode = consoleMode; - } -} diff --git a/hostscompress/Console.h b/hostscompress/Console.h deleted file mode 100644 index c514c89..0000000 --- a/hostscompress/Console.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once -#ifndef CONSOLE_H -#define CONSOLE_H -// CodePage -class CodePage -{ -private: - unsigned int initCodePage; - unsigned int initOutputCodePage; - unsigned int currentCodePage; - unsigned int currentOutputCodePage; -public: - void setInitCodePage(ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getInitCodePage(); - void getCodePage(ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getCurrentCodePage(); - void setCodePage(unsigned int codePage, ProgramError& perror, int errorValue, std::string errorMessage); - void setInitOutputCodePage(ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getInitOutputCodePage(); - void getOutputCodePage(ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getCurrentOutputCodePage(); - void setOutputCodePage(unsigned int outputCodePage, ProgramError& perror, int errorValue, std::string errorMessage); - CodePage(const unsigned int& initCodePage, const unsigned int& initOutputCodePage, const unsigned int& currentCodePage, const unsigned int& currentOutputCodePage) : initCodePage(initCodePage), initOutputCodePage(initOutputCodePage), currentCodePage(currentCodePage), currentOutputCodePage(currentOutputCodePage) {}; - bool operator==(const CodePage& other) const = default; - CodePage() - { - initCodePage = 0; - initOutputCodePage = 0; - currentCodePage = initCodePage; - currentOutputCodePage = initOutputCodePage; - }; -}; -class Handle -{ -private: - HANDLE inputHandle; - HANDLE outputHandle; - HANDLE errorHandle; -public: - void setInputHandle(ProgramError& perror, int errorValue, std::string errorMessage); - void setOutputHandle(ProgramError& perror, int errorValue, std::string errorMessage); - void setErrorHandle(ProgramError& perror, int errorValue, std::string errorMessage); - HANDLE getInputHandle(); - HANDLE getOutputHandle(); - HANDLE getErrorHandle(); -}; -class ConsoleMode -{ -private: - unsigned int initConsoleMode; - unsigned int currentConsoleMode; -public: - void setInitConsoleMode(HANDLE handle, ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getInitConsoleMode(); - void getConsoleMode(HANDLE handle, ProgramError& perror, int errorValue, std::string errorMessage); - unsigned int getCurrentConsoleMode(); - void setConsoleMode(HANDLE handle, unsigned int consoleMode, ProgramError& perror, int errorValue, std::string errorMessage); - ConsoleMode(const unsigned int& initConsoleMode, const unsigned int& currentConsoleMode) : initConsoleMode(initConsoleMode), currentConsoleMode(currentConsoleMode) {}; - bool operator==(const ConsoleMode& other) const = default; - ConsoleMode() - { - initConsoleMode = 0; - currentConsoleMode = initConsoleMode; - }; -}; -#endif // !CONSOLE_H \ No newline at end of file diff --git a/hostscompress/Functions.cpp b/hostscompress/Functions.cpp index 83fe765..5abee8e 100644 --- a/hostscompress/Functions.cpp +++ b/hostscompress/Functions.cpp @@ -1,15 +1,15 @@ -#include "pch.h" -#include "Functions.h" -const std::string GetWindowsDirectoryAsString(ProgramError& perror, int errorValue, std::string errorMessage) -{ - char path[MAX_PATH]; - unsigned int size = GetWindowsDirectoryA(path, sizeof(path)); - if (size == 0) - { - std::string message = GetLastErrorAsString(); - message.append(errorMessage); - perror.addError(errorValue, message); - return std::string(""); - } - return std::string(path); +#include "pch.h" +#include "Functions.h" +const std::string GetWindowsDirectoryAsString(ProgramError& perror, int errorValue, std::string errorMessage) +{ + char path[MAX_PATH]; + unsigned int size = GetWindowsDirectoryA(path, sizeof(path)); + if (size == 0) + { + std::string message = GetLastErrorAsString(); + message.append(errorMessage); + perror.addError(errorValue, message); + return std::string(""); + } + return std::string(path); } \ No newline at end of file diff --git a/hostscompress/Functions.h b/hostscompress/Functions.h index 113556d..d1b511d 100644 --- a/hostscompress/Functions.h +++ b/hostscompress/Functions.h @@ -1,2 +1,2 @@ -#pragma once +#pragma once const std::string GetWindowsDirectoryAsString(ProgramError &perror, int errorValue, std::string errorMessage); \ No newline at end of file diff --git a/hostscompress/ProgramError.cpp b/hostscompress/ProgramError.cpp index 82612ca..17ec77d 100644 --- a/hostscompress/ProgramError.cpp +++ b/hostscompress/ProgramError.cpp @@ -1,73 +1,73 @@ -#include "pch.h" -#include "ProgramError.h" -std::string GetLastErrorAsString() -{ - DWORD errorId = ::GetLastError(); - if (errorId == 0) - { - return std::string(); - } - LPSTR buffer = nullptr; - size_t messageSize = - FormatMessageA - ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, errorId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPSTR)&buffer, 0, NULL - ); - std::string message(buffer, messageSize); - LocalFree(buffer); - return message; -} -void SetCustomError(ProgramError& perror, int errorValue, std::string errorMessage) -{ - std::string workingMessage = GetLastErrorAsString(); - workingMessage.append(errorMessage); - perror.addError(errorValue, workingMessage); - perror.setError(errorValue); -} -void ProgramError::addError(int value, std::string message) -{ - errors[value] = message; -} -void ProgramError::setError(int errorNumber) -{ - currentError = { errorNumber, errors[errorNumber] }; -} -ErrorStruct ProgramError::getError() -{ - return currentError; -} -void ProgramError::print(bool color) -{ - std::string errorMessage = ((color) ? "\x1b[" : ""); - if (color) - { - errorMessage.append((currentError.value > 0) ? "91" : "92"); - errorMessage.push_back('m'); - } - errorMessage.append(currentError.message); - errorMessage.push_back(':'); - if (color) - { - errorMessage.append("\x1b[m"); - } - errorMessage.append(" ["); - if (color) - { - errorMessage.append("\x1b["); - errorMessage.append((currentError.value > 0) ? "91" : "92"); - errorMessage.push_back('m'); - } - errorMessage.append(std::to_string(currentError.value)); - if (color) - { - errorMessage.append("\x1b[m"); - } - errorMessage.push_back(']'); - if (currentError.value > 0) std::cerr << errorMessage << '\n'; - else std::cout << errorMessage << '\n'; +#include "pch.h" +#include "ProgramError.h" +std::string GetLastErrorAsString() +{ + DWORD errorId = ::GetLastError(); + if (errorId == 0) + { + return std::string(); + } + LPSTR buffer = nullptr; + size_t messageSize = + FormatMessageA + ( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, errorId, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&buffer, 0, NULL + ); + std::string message(buffer, messageSize); + LocalFree(buffer); + return message; +} +void SetCustomError(ProgramError& perror, int errorValue, std::string errorMessage) +{ + std::string workingMessage = GetLastErrorAsString(); + workingMessage.append(errorMessage); + perror.addError(errorValue, workingMessage); + perror.setError(errorValue); +} +void ProgramError::addError(int value, std::string message) +{ + errors[value] = message; +} +void ProgramError::setError(int errorNumber) +{ + currentError = { errorNumber, errors[errorNumber] }; +} +ErrorStruct ProgramError::getError() +{ + return currentError; +} +void ProgramError::print(bool color) +{ + std::string errorMessage = ((color) ? "\x1b[" : ""); + if (color) + { + errorMessage.append((currentError.value > 0) ? "91" : "92"); + errorMessage.push_back('m'); + } + errorMessage.append(currentError.message); + errorMessage.push_back(':'); + if (color) + { + errorMessage.append("\x1b[m"); + } + errorMessage.append(" ["); + if (color) + { + errorMessage.append("\x1b["); + errorMessage.append((currentError.value > 0) ? "91" : "92"); + errorMessage.push_back('m'); + } + errorMessage.append(std::to_string(currentError.value)); + if (color) + { + errorMessage.append("\x1b[m"); + } + errorMessage.push_back(']'); + if (currentError.value > 0) std::cerr << errorMessage << '\n'; + else std::cout << errorMessage << '\n'; } \ No newline at end of file diff --git a/hostscompress/ProgramError.h b/hostscompress/ProgramError.h index 61b71af..770d931 100644 --- a/hostscompress/ProgramError.h +++ b/hostscompress/ProgramError.h @@ -1,34 +1,34 @@ -#pragma once -std::string GetLastErrorAsString(); -struct ErrorStruct -{ - int value; - std::string message; - ErrorStruct(int &value, std::string &message) - : value(value), message(message) { }; - ErrorStruct() - { - value = 0; - message = "Success"; - }; -}; -class ProgramError -{ -private: - std::map<int, std::string> errors; - ErrorStruct currentError; -public: - ProgramError(std::map<int, std::string> &errors, ErrorStruct ¤tError) - : errors(errors), currentError(currentError) { }; - ProgramError() - { - errors.insert({ 0, "Success" }); - currentError.value = 0; - currentError.message = "Success"; - }; - void addError(int value, std::string message); - void setError(int errorNumber); - ErrorStruct getError(); - void print(bool color); -}; +#pragma once +std::string GetLastErrorAsString(); +struct ErrorStruct +{ + int value; + std::string message; + ErrorStruct(int &value, std::string &message) + : value(value), message(message) { }; + ErrorStruct() + { + value = 0; + message = "Success"; + }; +}; +class ProgramError +{ +private: + std::map<int, std::string> errors; + ErrorStruct currentError; +public: + ProgramError(std::map<int, std::string> &errors, ErrorStruct ¤tError) + : errors(errors), currentError(currentError) { }; + ProgramError() + { + errors.insert({ 0, "Success" }); + currentError.value = 0; + currentError.message = "Success"; + }; + void addError(int value, std::string message); + void setError(int errorNumber); + ErrorStruct getError(); + void print(bool color); +}; void SetCustomError(ProgramError& perror, int errorValue, std::string errorMessage); \ No newline at end of file diff --git a/hostscompress/Resource.aps b/hostscompress/Resource.aps index e4d1f03968be0f75a32b8d76fb84f218fab2343f..4bf29d0767e2e6eed9828977d87e451c3fd940a6 100644 GIT binary patch delta 309 zcmdnf&vK%lWr6~u*F;5S<})mellL%bGRK!0O)QYv*d5Er1QdD2xDX;DJ$V_EJ(M|# znTt_oGB0y6Ydk|4gVE%A=Hr_^SROF(GcYhQKmeHDY|dWE$Z5o&$6x@$lXr4dGMa2Q z=43?@-0aA;_!pzs^rtM0>Wo_^PLyYr1DbGVx*;p0JR1um1A_q5<adm6tTI5R#q>&6 zMrFo|>2pEUhv^4FRLFE+Hb&XWW^6*NVnCf!z})F(Y>Z-z4?t{VCKmR|_t>OZSMV_~ z?3ligjZvPlVfsN3<uUysh`KPHksU~VnXU+;Y^FN`DJGWplkdHgV$EOyIi?XL5i)%t HJEJrJI|xeI delta 286 zcmX@n&$6eVWr6~u`$R=$#sd>wwI{!4lHS-K%gFSPVe&i1g&^+awM_OvT9uiBL2R-p zbMfRp=3|?KSROI)GcqtTFaR->-t5d?$;fHQpvM5llaF##G8%8T=VV0^-0aJ>_!p!5 z^p7lz>WmwvOR_R5Go4_ZypB<h^&ikIp6Q9KjPh(^KywY4CrdHQu?7Q0bEdBZs$+aI z{Va&`nEsKK(U`FVM9EHfVq+9zyaHxVKF21+HU;R+A8gb6*cjy)*Gyl_#wgENGW{%w tvYGxCL>-yV%MPSoOxFcb2Gf0k6w{A))AQJYIu1<l1&Ml0U(3!Y4FK5^O1c05 diff --git a/hostscompress/Resource.rc b/hostscompress/Resource.rc index 02e4334f6505d92aa657f3e2f97e33c4904f6cf8..ec5032859a6030f135502516ce5d5d519edf2cfe 100644 GIT binary patch delta 76 zcmcbhc|mhS7YC;igARiM2v45Op^4yaKFX2E4CLwoC4qRdKF?W3lg)p5Y8g=kr8m#x HGhzb(obnLP delta 76 zcmcbhc|mhS7YC;ygAM~2PoB)7iQsKM%8|$n<mv$>fq1e$&sj#}&3}1n8BqkKH_ziU GVgmr3ToBO! diff --git a/hostscompress/hostscompress.cpp b/hostscompress/hostscompress.cpp index 7c58280..1e6eba4 100644 --- a/hostscompress/hostscompress.cpp +++ b/hostscompress/hostscompress.cpp @@ -1,7 +1,7 @@ // ╔══════════════════════════════════════════════════════════════════════════════════╗ // ║ Hosts Compress - Aggregate multiple domain names into single lines for local IP ║ // ║ addresses of 0.0.0.0 and 127.0.0.1. ║ -// ║ © 2023 Ian Pride - New Pride Software / Services ║ +// ║ © 2024 Ian Pride - New Pride Software / Services ║ // ╚══════════════════════════════════════════════════════════════════════════════════╝ #include "pch.h" const std::regex RGX_ISURL_000("^0.0.0.0[\\s]+(?!(0.0.0.0$|127.0.0.1$|local$|localhost$|localhost.localdomain$)).*"); @@ -52,7 +52,7 @@ std::string ColorString(std::string string, int color, Options& options) unsigned int ParseArguments(ArgumentParser &argumentParser, Options& options, ProgramError &perror) { const std::vector<std::string> MONOCHROMEOPTIONS{ "/m", "/monochrome" }; - const std::vector<std::string> HELPOPTIONS{ "/h", "/help" }; + const std::vector<std::string> HELPOPTIONS{ "/h", "/help", "/?"}; const std::vector<std::string> INPUTFILEOPTIONS{ "/i", "/input" }; const std::vector<std::string> OUTPUTFILEOPTIONS{ "/o", "/output" }; const std::vector<std::string> COUNTOPTIONS{ "/c", "/count" }; @@ -83,7 +83,7 @@ unsigned int ParseArguments(ArgumentParser &argumentParser, Options& options, Pr ">]" "\n" "\n @" << ColorString("SWITCHES", 92, options) << ":" - "\n /h, /help This help message." + "\n /h, /help, /? This help message." "\n /m, /monochrome Verbose output is void of color." "\n /q, /quiet No verbosity; silences all errors and output with the errors" "\n and output with the exception of the resulting compression" @@ -230,24 +230,8 @@ std::u8string IncrementString(std::u8string string, int increment) } void CompressUrls(Options& options, std::vector<std::string> &urls, std::vector < std::string> &output, std::string pre) { - const std::u8string BLOCK = u8"█"; - const std::u8string LBRACKET = u8"〘"; - const std::u8string RBRACKET = u8"〙"; - std::string spaces; - std::u8string nextCharacter; - int stepIndex{}; - int progressIndex{}; - if (!options.isQuiet) - { - stepIndex = 0; - progressIndex = 0; - spaces = IncrementString(" ", 100); - nextCharacter = IncrementString(BLOCK, 0); - std::cout << "\x1b[s" << (const char*)LBRACKET.c_str() << (const char*)nextCharacter.c_str() << spaces << (const char*)RBRACKET.c_str() << "0%"; - } for (int index = 0; index <= (int)(urls.size() - options.urlsPerLine); index += options.urlsPerLine) { - if (!options.isQuiet) progressIndex = ((index * 100) / (int)(urls.size())); std::stringstream ss; ss << pre << ' '; for (int index2 = 0; index2 < options.urlsPerLine; index2++) @@ -257,13 +241,6 @@ void CompressUrls(Options& options, std::vector<std::string> &urls, std::vector if (index2 < (options.urlsPerLine - 1)) ss << ' '; } output.push_back(ss.str()); - if ((!options.isQuiet) && (progressIndex > stepIndex)) - { - stepIndex++; - nextCharacter = IncrementString(u8"█", stepIndex); - spaces = IncrementString(" ", (100 - stepIndex)); - std::cout << "\x1b[u" << (const char*)LBRACKET.c_str() << (const char*)nextCharacter.c_str() << spaces << (const char*)RBRACKET.c_str() << stepIndex << '%'; - } } int leftOver = (int)(urls.size() - (output.size() * options.urlsPerLine)); if (leftOver > 0) @@ -282,10 +259,6 @@ void CompressUrls(Options& options, std::vector<std::string> &urls, std::vector } if (!options.isQuiet) { - stepIndex = 100; - nextCharacter = IncrementString(u8"█", stepIndex); - spaces = IncrementString(" ", (100 - stepIndex)); - std::cout << "\x1b[u" << (const char*)LBRACKET.c_str() << (const char*)nextCharacter.c_str() << spaces << (const char*)RBRACKET.c_str() << stepIndex << "%\n"; std::cout <<"Compressed [" << (options.isOutputColor ? "\x1b[93m" : "") @@ -357,11 +330,6 @@ int main(int argc, const char* argv[]) { ProgramError perror; Options options; - CodePage cp; - Handle handle{}; - ConsoleMode - inputConsoleMode, - outputConsoleMode; auto errorTest = [options](ProgramError& perror) { if (perror.getError().value > 0) @@ -404,36 +372,6 @@ int main(int argc, const char* argv[]) perror.print(options.isOutputColor); return perror.getError().value; } - cp.setInitCodePage(perror, 8, "Could not get the initial code page."); - errorTest(perror); - if (cp.getCurrentCodePage() != CP_UTF8) - { - cp.setCodePage(CP_UTF8, perror, 9, "Could not set the current code page."); - errorTest(perror); - } - handle.setInputHandle(perror, 10, "Could not retrieve console input handle."); - errorTest(perror); - - inputConsoleMode.setInitConsoleMode(handle.getInputHandle(), perror, 11, ""); - errorTest(perror); - inputConsoleMode.setConsoleMode - ( - handle.getInputHandle(), - ENABLE_VIRTUAL_TERMINAL_INPUT | ENABLE_PROCESSED_INPUT, - perror, 12, "" - ); - errorTest(perror); - handle.setOutputHandle(perror, 12, "Could not retrieve console input handle."); - errorTest(perror); - outputConsoleMode.setInitConsoleMode(handle.getOutputHandle(), perror, 13, ""); - errorTest(perror); - outputConsoleMode.setConsoleMode - ( - handle.getOutputHandle(), - ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT, - perror, 14, "" - ); - errorTest(perror); SetConsoleTitle(L"Hosts Compress"); PrintMessage ( @@ -563,20 +501,5 @@ int main(int argc, const char* argv[]) options ); } - if (cp.getCurrentCodePage() != cp.getInitCodePage()) - { - cp.setCodePage(cp.getInitCodePage(), perror, 17, "Could not set the code page to the initial value."); - errorTest(perror); - } - if (inputConsoleMode.getCurrentConsoleMode() != inputConsoleMode.getInitConsoleMode()) - { - inputConsoleMode.setConsoleMode(handle.getInputHandle(), inputConsoleMode.getInitConsoleMode(), perror, 18, "Could not set the console mode to the initial value."); - errorTest(perror); - } - if (outputConsoleMode.getCurrentConsoleMode() != outputConsoleMode.getInitConsoleMode()) - { - outputConsoleMode.setConsoleMode(handle.getOutputHandle(), outputConsoleMode.getInitConsoleMode(), perror, 19, "Could not set the console mode to the initial value."); - errorTest(perror); - } return EXIT_SUCCESS; } \ No newline at end of file diff --git a/hostscompress/hostscompress.vcxproj b/hostscompress/hostscompress.vcxproj index bb88c35..8ee0f4b 100644 --- a/hostscompress/hostscompress.vcxproj +++ b/hostscompress/hostscompress.vcxproj @@ -1,173 +1,171 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <VCProjectVersion>17.0</VCProjectVersion> - <Keyword>Win32Proj</Keyword> - <ProjectGuid>{0e403787-d280-404b-9198-2f7e0a9d42ec}</ProjectGuid> - <RootNamespace>hostscompress</RootNamespace> - <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v143</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v143</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v143</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v143</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="Shared"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>true</ConformanceMode> - <LanguageStandard>stdcpp20</LanguageStandard> - <PrecompiledHeader>Use</PrecompiledHeader> - <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>true</ConformanceMode> - <LanguageStandard>stdcpp20</LanguageStandard> - <PrecompiledHeader>Use</PrecompiledHeader> - <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> - <Optimization>MaxSpeed</Optimization> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>true</ConformanceMode> - <LanguageStandard>stdcpp20</LanguageStandard> - <PrecompiledHeader>Use</PrecompiledHeader> - <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>true</ConformanceMode> - <LanguageStandard>stdcpp20</LanguageStandard> - <PrecompiledHeader>Use</PrecompiledHeader> - <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> - <Optimization>MaxSpeed</Optimization> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="ArgumentParser.cpp" /> - <ClCompile Include="Console.cpp" /> - <ClCompile Include="Functions.cpp" /> - <ClCompile Include="hostscompress.cpp" /> - <ClCompile Include="pch.cpp"> - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> - </ClCompile> - <ClCompile Include="ProgramError.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="ArgumentParser.h" /> - <ClInclude Include="Console.h" /> - <ClInclude Include="Functions.h" /> - <ClInclude Include="pch.h" /> - <ClInclude Include="ProgramError.h" /> - <ClInclude Include="resource.h" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="Resource.rc" /> - </ItemGroup> - <ItemGroup> - <Image Include="icon1.ico" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>17.0</VCProjectVersion> + <Keyword>Win32Proj</Keyword> + <ProjectGuid>{0e403787-d280-404b-9198-2f7e0a9d42ec}</ProjectGuid> + <RootNamespace>hostscompress</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level4</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <LanguageStandard>stdcpp20</LanguageStandard> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level4</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <LanguageStandard>stdcpp20</LanguageStandard> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + <Optimization>MaxSpeed</Optimization> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level4</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <LanguageStandard>stdcpp20</LanguageStandard> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level4</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <LanguageStandard>stdcpp20</LanguageStandard> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + <Optimization>MaxSpeed</Optimization> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="ArgumentParser.cpp" /> + <ClCompile Include="Functions.cpp" /> + <ClCompile Include="hostscompress.cpp" /> + <ClCompile Include="pch.cpp"> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> + </ClCompile> + <ClCompile Include="ProgramError.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="ArgumentParser.h" /> + <ClInclude Include="Functions.h" /> + <ClInclude Include="pch.h" /> + <ClInclude Include="ProgramError.h" /> + <ClInclude Include="resource.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Resource.rc" /> + </ItemGroup> + <ItemGroup> + <Image Include="icon1.ico" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> </Project> \ No newline at end of file diff --git a/hostscompress/hostscompress.vcxproj.filters b/hostscompress/hostscompress.vcxproj.filters index 15ebff1..be25e7c 100644 --- a/hostscompress/hostscompress.vcxproj.filters +++ b/hostscompress/hostscompress.vcxproj.filters @@ -1,67 +1,61 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="hostscompress.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pch.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ProgramError.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="Console.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ArgumentParser.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="Functions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="pch.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ProgramError.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="Console.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ArgumentParser.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="Functions.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="resource.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="Resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <Image Include="icon1.ico"> - <Filter>Resource Files</Filter> - </Image> - </ItemGroup> +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="hostscompress.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="pch.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="ProgramError.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="ArgumentParser.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Functions.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="pch.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="ProgramError.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="ArgumentParser.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Functions.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Resource.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <Image Include="icon1.ico"> + <Filter>Resource Files</Filter> + </Image> + </ItemGroup> </Project> \ No newline at end of file diff --git a/hostscompress/hostscompress.vcxproj.user b/hostscompress/hostscompress.vcxproj.user index 88a5509..0f14913 100644 --- a/hostscompress/hostscompress.vcxproj.user +++ b/hostscompress/hostscompress.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup /> +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> </Project> \ No newline at end of file diff --git a/hostscompress/pch.h b/hostscompress/pch.h index c9fdec3..59cee4e 100644 --- a/hostscompress/pch.h +++ b/hostscompress/pch.h @@ -1,18 +1,18 @@ -#ifndef PCH_H -#define PCH_H -#include <Windows.h> -#include <iostream> -#include <string> -#include <map> -#include <vector> -#include <regex> -#include <filesystem> -#include <fstream> -#include <sstream> -#include "ProgramError.h" -#include "Console.h" -#include "ArgumentParser.h" -#include "Functions.h" -#endif // !PCH_H - - +#ifndef PCH_H +#define PCH_H +#include <Windows.h> +#include <iostream> +#include <string> +#include <map> +#include <vector> +#include <regex> +#include <filesystem> +#include <fstream> +#include <sstream> +#include "ProgramError.h" +//#include "Console.h" +#include "ArgumentParser.h" +#include "Functions.h" +#endif // !PCH_H + + diff --git a/hostscompress/resource.h b/hostscompress/resource.h index 191b694..7bb73d3 100644 --- a/hostscompress/resource.h +++ b/hostscompress/resource.h @@ -1,16 +1,16 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc -// -#define IDI_ICON1 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Resource.rc +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif