cleanup
This commit is contained in:
parent
d998cd4a5a
commit
6c03201662
@ -1,9 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <experimental/filesystem>
|
|
||||||
|
|
||||||
using namespace std;
|
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)");
|
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",
|
const auto res = sscanf_s(date_as_string.c_str(), "%2d.%2d.%4d",
|
||||||
&day,
|
&day,
|
||||||
&month,
|
&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))
|
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;
|
cout << "Fehlerhafte Eingabe." << endl;
|
||||||
}
|
}
|
||||||
@ -360,6 +362,7 @@ bool validate_reservation(reservation* const reservation)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_reservation()
|
void create_reservation()
|
||||||
|
@ -107,11 +107,15 @@
|
|||||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<BrowseInformation>true</BrowseInformation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Bscmake>
|
||||||
|
<PreserveSbr>true</PreserveSbr>
|
||||||
|
</Bscmake>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user