diff --git a/src/Motorradvermietung.cpp b/src/Motorradvermietung.cpp index 76717e4..1de9ef3 100644 --- a/src/Motorradvermietung.cpp +++ b/src/Motorradvermietung.cpp @@ -684,6 +684,9 @@ reservation* get_reservation_for_customer(customer* const current_customer) return reservations_of_customer[index - 1]; } +/** + * \brief Puts the motorcycle out to the customer. + */ void rent_a_motorcycle() { system("cls"); @@ -709,7 +712,11 @@ void rent_a_motorcycle() system("pause"); } -string current_date_time() +/** + * \brief Gets current date and time. + * \return Date & Time formatted as: DD.MM.YYYY HH:MM:SS + */ +string get_current_date_time() { auto t = time(nullptr); struct tm buf{}; @@ -724,11 +731,15 @@ string current_date_time() return date + " " + time; } +/** + * \brief Exports the current reservations list into a file. + * If file already exists, it will be appended. + */ void export_reservations() { ofstream f; f.open("reservierungen.txt", ios::app); - f << "Export (" << current_date_time() << ")" << endl; + f << "Export (" << get_current_date_time() << ")" << endl; f << "Id;Motorcycle;Start;End;Name;First_Name;Cancelled" << endl; for (auto reservation : reservations) { @@ -742,4 +753,4 @@ void export_reservations() } f << "------------" << endl; f.close(); -} +} \ No newline at end of file