* enforce standards conformance on MSVC * add \W4 flag for test compilation * enable compiler warnings for the library target when building tests * update note on testing frameworks * turns out only clang understands strongly typed enums
19 lines
449 B
C++
19 lines
449 B
C++
#include <greeter.h>
|
|
|
|
using namespace greeter;
|
|
|
|
Greeter::Greeter(std::string _name) : name(_name) {}
|
|
|
|
std::string Greeter::greet(LanguageCode lang) const {
|
|
switch (lang) {
|
|
default:
|
|
case LanguageCode::EN:
|
|
return "Hello, " + name + "!";
|
|
case LanguageCode::DE:
|
|
return "Hallo " + name + "!";
|
|
case LanguageCode::ES:
|
|
return "¡Hola " + name + "!";
|
|
case LanguageCode::FR:
|
|
return "Bonjour " + name + "!";
|
|
}
|
|
}
|