cleanup
This commit is contained in:
parent
d998cd4a5a
commit
6c03201662
@ -1,9 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <experimental/filesystem>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -301,7 +299,7 @@ date get_validated_date(const string&& question)
|
||||
{
|
||||
auto date_as_string = ask_question<string>(question + " (tt.mm.jjjj)");
|
||||
|
||||
unsigned short day = 0, month = 0, year = 0;
|
||||
auto day = 0, month = 0, year = 0;
|
||||
const auto res = sscanf_s(date_as_string.c_str(), "%2d.%2d.%4d",
|
||||
&day,
|
||||
&month,
|
||||
@ -309,7 +307,11 @@ date get_validated_date(const string&& question)
|
||||
|
||||
if (res == 3 && (month >= 1 && month <= 12) && (day >= 1 && day <= 31) && (year >= 1900 && month <= 2200))
|
||||
{
|
||||
return date{day, month, year};
|
||||
return date{
|
||||
static_cast<const unsigned short>(day),
|
||||
static_cast<const unsigned short>(month),
|
||||
static_cast<const unsigned short>(year)
|
||||
};
|
||||
}
|
||||
cout << "Fehlerhafte Eingabe." << endl;
|
||||
}
|
||||
@ -352,14 +354,15 @@ bool validate_reservation(reservation* const reservation)
|
||||
{
|
||||
for (auto r : reservations)
|
||||
{
|
||||
if(r->get_motorcycle() == reservation->get_motorcycle())
|
||||
if (r->get_motorcycle() == reservation->get_motorcycle())
|
||||
{
|
||||
if(reservation->get_start_date().get_sum() > r->get_end_date().get_sum())
|
||||
if (reservation->get_start_date().get_sum() > r->get_end_date().get_sum())
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void create_reservation()
|
||||
|
@ -107,11 +107,15 @@
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<PreserveSbr>true</PreserveSbr>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user