From 5f35f97b2ee489e405ad557fa18ef8db2ebf4553 Mon Sep 17 00:00:00 2001 From: MichaelBrunner Date: Sat, 1 Jun 2024 13:26:23 +0200 Subject: [PATCH] ENH: change package manager to vcpkg --- .github/workflows/build-matrix.yml | 2 +- gtfs/src/GtfsAgencyReaderStrategy.cpp | 48 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-matrix.yml b/.github/workflows/build-matrix.yml index 20cd8d51..d3fae097 100644 --- a/.github/workflows/build-matrix.yml +++ b/.github/workflows/build-matrix.yml @@ -37,4 +37,4 @@ jobs: - name: Build run: | - cmake --build build --config Release --preset release + cmake --build build --config Release diff --git a/gtfs/src/GtfsAgencyReaderStrategy.cpp b/gtfs/src/GtfsAgencyReaderStrategy.cpp index 4f79d69b..6b09a2ac 100644 --- a/gtfs/src/GtfsAgencyReaderStrategy.cpp +++ b/gtfs/src/GtfsAgencyReaderStrategy.cpp @@ -4,6 +4,8 @@ #include "GtfsAgencyReaderStrategy.h" +#include "fields/Agency.h" + #include namespace gtfs { @@ -19,6 +21,52 @@ namespace gtfs { } // gtfs +/* +#include +#include +#include +#include + + +int main() { + // Open the input file + std::ifstream infile("tfs_agency.txt"); + if (!infile.is_open()) { + std::cerr << "Error opening file." << std::endl; + return 1; + } + + // Create a vector to store agency data + std::vector agencies; + + // Read data from the file + std::string line; + while (std::getline(infile, line)) { + gtfs::Agency agency; + std::size_t comma1 = line.find(','); + std::size_t comma2 = line.find(',', comma1 + 1); + + if (comma1 != std::string::npos && comma2 != std::string::npos) { + agency.name = line.substr(0, comma1); + agency.location = line.substr(comma1 + 1, comma2 - comma1 - 1); + agency.employees = std::stoi(line.substr(comma2 + 1)); + agencies.push_back(agency); + } + } + + // Close the file + infile.close(); + + // Print agency data + for (const auto& ag : agencies) { + std::cout << "Agency Name: " << ag.name << std::endl; + std::cout << "Location: " << ag.location << std::endl; + std::cout << "Employees: " << ag.employees << std::endl; + std::cout << "-------------------------" << std::endl; + } + + return 0; +}*/ /*