Plik testowy, importy i funkcja zapisująca do pliku

This commit is contained in:
2023-02-22 17:27:57 +01:00
parent f4b109c96a
commit 4cbfef5bc2
3 changed files with 10 additions and 0 deletions

View File

View File

@@ -69,6 +69,14 @@ void dijkstruj(mapa doDijkstrnięcia){
}
}
void dumpOutput(string outputFile, string preparedString)
{
ofstream file(outputFile);
file << preparedString;
}
/**
* @brief Funkcja parsująca dane wejściowe.
*
@@ -127,6 +135,7 @@ int main (int argc, char *argv[])
parseInput(plikWejsciowy);
dijkstruj(mapaOdległości);
plikWyjsciowy = result["output"].as<string>();
} else {
std::cout << std::endl << "Błąd - nie podano wymaganych parametrów" << std::endl << std::endl << std::endl << options.help() << std::endl;
exit(3);

1
Projekt/testfile Normal file
View File

@@ -0,0 +1 @@
(1 - 2 : 4.5), (4 -> 3 : 4.5), (4 - 2 : 0.4), (1 - 3 : 2.1), (2 - 4 : 3.2), (3 -> 1 : 1.5), (2 - 5 : 5.5), (5 - 4 : 2.3), (3 - 6 : 4.1), (6 - 5 : 3.2), (1 - 7 : 6.5), (7 - 6 : 2.7), (2 - 8 : 7.1), (8 - 7 : 3.8), (3 - 9 : 5.2), (9 - 8 : 4.1), (4 - 10 : 6.3), (10 - 9 : 2.5), (5 - 11 : 5.1), (11 - 10 : 3.6), (6 - 12 : 4.7), (12 - 11 : 2.9), (7 - 13 : 3.4), (13 - 12 : 2.5), (8 - 14 : 4.1), (14 - 13 : 3.3), (9 - 15 : 5.8), (15 - 14 : 2.7), (10 - 16 : 4.2), (16 - 15 : 3.1), (11 - 17 : 5.5), (17 - 16 : 2.8), (12 - 18 : 4.9), (18 - 17 : 3.2), (13 - 19 : 6.1), (19 - 18 : 2.5), (14 - 20 : 5.2), (20 - 19 : 3.6), (15 - 21 : 4.7), (21 - 20 : 2.9), (16 -> 22 : 5.1), (22 -> 21 : 3.6), (17 -> 23 : 4.2), (23 - 22 : 2.8), (18 - 24 : 3.9), (24 - 23 : 2.5), (19 - 25 : 5.8), (25 - 24 : 3.3), (20 - 26 : 4.2), (26 - 25 : 2.7), (21 - 27 : 5.5), (27 - 26 : 3.2), (22 - 28 : 4.9), (28 - 27 : 2.8), (23 - 29 : 6.1), (29 - 28 : 2.5), (24 - 30 : 5.2), (30 - 29 : 3.6), (25 - 31 : 4.7), (31 - 30 : 2.9), (26 - 32 : 5.1), (32 - 31 : 3.6), (27 - 33 : 4.2), (33 -> 32 : 2.8), (28 - 34 : 3.9), (34 - 33 : 2.5), (29 -> 35 : 5.8), (35 - 34 : 3.3), (30 - 36 : 4.2), (36 - 35 : 2.7), (31 - 37 : 5.5), (37 - 36 : 3.2), (32 - 38 : 4.9), (38 - 37 : 2.8), (33 - 39 : 6.1), (39 - 38 : 2.5), (34 - 40 : 5.2), (40 - 39 : 3.6), (35 - 41 : 4.7), (41 -> 40 : 2.9)