Dużo zmian a terminy gonią...

This commit is contained in:
2023-02-13 00:39:52 +01:00
parent d270357722
commit 5d5527ee06

View File

@@ -30,10 +30,41 @@ uruchomienie programu bez parametrów powoduje wypisanie krótkiej instrukcji
#include <iostream>
#include <iomanip>
#include <string>
#include <cxxopts.hpp>
cxxopts::Options options("Kurier", "Program rozwiązujący problem kuriera");
#include "include/cxxopts.hpp"
#include <algorithm>
#include <limits.h>
#include <queue>
#include <fstream>
#include <sstream>
using namespace std;
cxxopts::Options options("Kurier", "Program rozwiązujący problem kuriera");
/*
*
* Parsujemy A, B, rodzaj korelacji <bool>, dystans
*
*
*/
std::vector<std::vector<double>> macierzOdległości;
/*
* @brief Funkcja czyszcząca stringi z niepotrzebnych znaków
*/
void czyscStringa( string &str, char* znakiDoCzyszczenia ) {
for ( unsigned int i = 0; i < strlen(znakiDoCzyszczenia); ++i ) {
str.erase( remove(str.begin(), str.end(), znakiDoCzyszczenia[i]), str.end() );
}
}
/**
* @brief Funkcja parsująca dane wejściowe.
*
@@ -43,9 +74,13 @@ using namespace std;
*
* @return iterator pliku
*/
int parseInput(char* inputFile) {
fopen(inputFile, "r");
return 0;
void parseInput(string inputFile) {
ifstream file(inputFile);
std::string token;
while(std::getline(file, token, ',')) {
czyscStringa(token, "()");
std::cout << token << std::endl;
}
}
/**
* @brief Główna funkcja.
@@ -73,9 +108,10 @@ int main (int argc, char *argv[])
string plikWyjsciowy;
if (result.count("input") && result.count("output")) {
plikWejsciowy = result["input"].as<string>();
parseInput(plikWejsciowy);
plikWyjsciowy = result["output"].as<string>();
} else {
std::cout << "Błąd 03 - nie podano wymaganych parametrów" << std::endl << options.help() << std::endl;
std::cout << std::endl << "Błąd 03 - nie podano wymaganych parametrów" << std::endl << std::endl << std::endl << options.help() << std::endl;
exit(3);
}
if (debug == true) {