Skip to content

Commit

Permalink
New Pre-release test for v2 - 17:47 Saturday, March 6, 2024 Universal…
Browse files Browse the repository at this point in the history
… Time Coordinated
  • Loading branch information
Lateralus138 committed Mar 6, 2024
1 parent 58e78ba commit 2455528
Show file tree
Hide file tree
Showing 22 changed files with 612 additions and 915 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/main_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions docs/md/pre-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down
8 changes: 5 additions & 3 deletions docs/md/release.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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.

---

Expand Down
76 changes: 38 additions & 38 deletions hostscompress/ArgumentParser.cpp
Original file line number Diff line number Diff line change
@@ -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;
}
26 changes: 13 additions & 13 deletions hostscompress/ArgumentParser.h
Original file line number Diff line number Diff line change
@@ -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;
};

Loading

0 comments on commit 2455528

Please sign in to comment.