-
Notifications
You must be signed in to change notification settings - Fork 0
/
primeexpertmenudialog.cpp
72 lines (64 loc) · 1.6 KB
/
primeexpertmenudialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "primeexpertmenudialog.h"
#include <cassert>
#include <iostream>
#include "primeexpert.h"
int ribi::PrimeExpertMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
const int argc = static_cast<int>(argv.size());
assert(argc > 0);
if (argc == 1)
{
std::cout << this->GetHelp() << '\n';
return 0;
}
PrimeExpert p;
std::cout << std::boolalpha;
for (int i{1}; i!=argc; ++i)
{
const int value{std::stoi(argv[i])};
std::cout << value << ": " << p.IsPrime(value) << '\n';
}
return 0;
}
ribi::About ribi::PrimeExpertMenuDialog::GetAbout() const noexcept
{
About a(
"Richel Bilderbeek",
"PrimeExpert",
"prime look-up table",
"November 21sh of 2015",
"2008-2015",
"http://www.richelbilderbeek.nl/ToolPrimeExpert.htm",
GetVersion(),
GetVersionHistory()
);
return a;
}
ribi::Help ribi::PrimeExpertMenuDialog::GetHelp() const noexcept
{
return Help(
this->GetAbout().GetFileTitle(),
this->GetAbout().GetFileDescription(),
{
}
,
{
"PrimeExpert 123",
"PrimeExpert 1 4 9 16"
}
);
}
std::string ribi::PrimeExpertMenuDialog::GetVersion() const noexcept
{
return "3.0";
}
std::vector<std::string> ribi::PrimeExpertMenuDialog::GetVersionHistory() const noexcept
{
return {
"2008-07-12: Version 1.0: initial version in C++ Builder",
"2011-02-26: Version 2.0: port to Qt Creator",
"2013-10-11: Version 2.1: conformized for ProjectRichelBilderbeek",
"2013-11-04: Version 2.2: conformized for ProjectRichelBilderbeekConsole",
"2015-11-21: Version 3.0: moved to own GitHub"
};
}