MyModernCppStarter/source/greeter.cpp
Lars Melchior a4881dda8b
enforce standards conformance on MSVC and fix warning flags (#10)
* 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
2020-04-15 09:12:12 +02:00

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 + "!";
}
}