Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b11d3614b8 | ||
|
|
2060f2ba65 | ||
|
|
6ad51789ca | ||
|
|
c8ea15f311 |
@@ -1,3 +1,3 @@
|
||||
# ReportTruncate-Robinson
|
||||
|
||||
Truncates the daily report from the BonAppetit system. Modifications for the Robinson store.
|
||||
Truncates the daily report from the BonAppetit system. Modifications for the Alameda store.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <vector>
|
||||
#include <regex>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
static const std::regex number_regex_full(R"(\d+)");
|
||||
static const std::regex number_regex_1to3(R"(\b\d{1,3}\b)");
|
||||
@@ -64,11 +63,8 @@ int main(int argc, char* argv[]) {
|
||||
bool has_bbgyro = false;
|
||||
bool has_subs = false;
|
||||
for (const auto& l : lines) {
|
||||
std::string lower = l;
|
||||
std::transform(lower.begin(), lower.end(), lower.begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
if (!has_bbgyro && lower.find("bbgyrs") != std::string::npos) has_bbgyro = true;
|
||||
if (!has_subs && lower.find("subs") != std::string::npos) has_subs = true;
|
||||
if (!has_bbgyro && l.find("BBGYRO") != std::string::npos) has_bbgyro = true;
|
||||
if (!has_subs && l.find("SUBS") != std::string::npos) has_subs = true;
|
||||
if (has_bbgyro || has_subs) break;
|
||||
}
|
||||
|
||||
@@ -105,7 +101,7 @@ int main(int argc, char* argv[]) {
|
||||
int gyros = 0;
|
||||
bool gyros_found = false;
|
||||
size_t bbgyro_index = std::string::npos;
|
||||
const std::string bbgyro_token = "BBGYRS";
|
||||
const std::string bbgyro_token = "BBGYRO";
|
||||
|
||||
for (size_t i = 0; i < lines.size(); ++i) {
|
||||
size_t pos = lines[i].find(bbgyro_token);
|
||||
@@ -143,10 +139,7 @@ int main(int argc, char* argv[]) {
|
||||
int subs_count = 0;
|
||||
size_t subs_index = std::string::npos;
|
||||
for (size_t i = 0; i < lines.size(); ++i) {
|
||||
std::string lower = lines[i];
|
||||
std::transform(lower.begin(), lower.end(), lower.begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
if (lower.find("subs") != std::string::npos) {
|
||||
if (lines[i].find("SUBS") != std::string::npos) {
|
||||
subs_count++;
|
||||
if (subs_count == 2) {
|
||||
subs_index = i;
|
||||
Binary file not shown.
BIN
ReportTruncate.exe
Executable file
BIN
ReportTruncate.exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user