16 return c ==
' ' || c ==
'\n' || c ==
'\t' || c ==
'\r';
25 std::string::const_iterator it = str.begin();
27 while (it != str.end())
31 if (++it == str.end())
return false;
35 const char* wi = word;
39 if (it == str.end() ||
is_white(*it))
43 if (it == str.end())
return false;
48 if (++it == str.end())
return false;
61 std::string::const_iterator it = str.begin();
63 while (it != str.end())
67 if (++it == str.end())
return false;
71 std::string::const_iterator wi = word.begin();
74 if (wi == word.end()) {
75 if (it == str.end() ||
is_white(*it))
79 if (it == str.end())
return false;
84 if (++it == str.end())
return false;
bool contains_word(const std::string &str, const char *word)
Search the given string for a whitespace-delimited word.
static bool is_white(char c)