Compare commits
3 Commits
0.6_workin
...
robinson
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ce92848ce | ||
|
|
9b9c0fbd53 | ||
|
|
448d9c2c5d |
@@ -4,6 +4,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
static const std::regex number_regex_full(R"(\d+)");
|
static const std::regex number_regex_full(R"(\d+)");
|
||||||
static const std::regex number_regex_1to3(R"(\b\d{1,3}\b)");
|
static const std::regex number_regex_1to3(R"(\b\d{1,3}\b)");
|
||||||
@@ -63,8 +64,11 @@ int main(int argc, char* argv[]) {
|
|||||||
bool has_bbgyro = false;
|
bool has_bbgyro = false;
|
||||||
bool has_subs = false;
|
bool has_subs = false;
|
||||||
for (const auto& l : lines) {
|
for (const auto& l : lines) {
|
||||||
if (!has_bbgyro && l.find("BBGYRO") != std::string::npos) has_bbgyro = true;
|
std::string lower = l;
|
||||||
if (!has_subs && l.find("SUBS") != std::string::npos) has_subs = true;
|
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 || has_subs) break;
|
if (has_bbgyro || has_subs) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +105,7 @@ int main(int argc, char* argv[]) {
|
|||||||
int gyros = 0;
|
int gyros = 0;
|
||||||
bool gyros_found = false;
|
bool gyros_found = false;
|
||||||
size_t bbgyro_index = std::string::npos;
|
size_t bbgyro_index = std::string::npos;
|
||||||
const std::string bbgyro_token = "BBGYRO";
|
const std::string bbgyro_token = "BBGYRS";
|
||||||
|
|
||||||
for (size_t i = 0; i < lines.size(); ++i) {
|
for (size_t i = 0; i < lines.size(); ++i) {
|
||||||
size_t pos = lines[i].find(bbgyro_token);
|
size_t pos = lines[i].find(bbgyro_token);
|
||||||
@@ -139,7 +143,10 @@ int main(int argc, char* argv[]) {
|
|||||||
int subs_count = 0;
|
int subs_count = 0;
|
||||||
size_t subs_index = std::string::npos;
|
size_t subs_index = std::string::npos;
|
||||||
for (size_t i = 0; i < lines.size(); ++i) {
|
for (size_t i = 0; i < lines.size(); ++i) {
|
||||||
if (lines[i].find("SUBS") != std::string::npos) {
|
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) {
|
||||||
subs_count++;
|
subs_count++;
|
||||||
if (subs_count == 2) {
|
if (subs_count == 2) {
|
||||||
subs_index = i;
|
subs_index = i;
|
||||||
BIN
ReportTruncate-Robinson.exe
Executable file
BIN
ReportTruncate-Robinson.exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user