Created
November 26, 2016 21:25
-
-
Save Skarlso/9108cfc7a45fdb84d7e094fff1a217cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright [2016] <Gergely Brautigam> | |
#include "./bob.h" | |
#include <boost/algorithm/string.hpp> | |
#include <string> | |
std::string bob::hey(std::string text) { | |
boost::trim_right(text); | |
if (text.empty()) { | |
return "Fine. Be that way!"; | |
} | |
if (text == boost::to_upper_copy<std::string>(text) | |
&& text != boost::to_lower_copy<std::string>(text)) | |
return "Whoa, chill out!"; | |
else if (text.back() == '?') | |
return "Sure."; | |
else | |
return "Whatever."; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef BOB_H | |
#define BOB_H | |
#define EXERCISM_RUN_ALL_TESTS | |
#include <string> | |
namespace bob { | |
std::string hey(std::string text); | |
} | |
#endif // BOB_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment