xxtelebot  1.4.1.0
A simple Telegram Bot implementation in C++
str_match.h
1 #ifndef TGBOT_STR_MATCH_H
2 #define TGBOT_STR_MATCH_H
3 
4 #include <cstring>
5 #include <string>
6 
7 namespace tgbot {
8  namespace utils {
9 
16  inline bool whenStarts(const std::string &target, const char *what) {
17  return target.compare(0, strlen(what), what) == 0;
18  }
19 
26  inline bool whenContains(const std::string &target, const char *what) {
27  return target.find(what) != std::string::npos;
28  }
29 
30  } // namespace utils
31 } // namespace tgbot
32 
33 #endif // TGBOT_STR_MATCH_H
bool whenContains(const std::string &target, const char *what)
whenContains (see RegisterCallback::callback() )
Definition: str_match.h:26
Main tgbot namespace.
Definition: bot.h:13
bool whenStarts(const std::string &target, const char *what)
whenStarts (see RegisterCallback::callback() )
Definition: str_match.h:16