Lines Matching refs:str
50 impl::duplicate(const char* str)
52 char* copy = new char[std::strlen(str) + 1];
53 std::strcpy(copy, str);
58 impl::match(const std::string& str, const std::string& regex)
64 found = str.empty();
72 const int res = ::regexec(&preg, str.c_str(), 0, NULL, 0);
84 impl::to_lower(const std::string& str)
87 for (std::string::const_iterator iter = str.begin(); iter != str.end();
94 impl::split(const std::string& str, const std::string& delim)
99 while (pos < str.length() && newpos != std::string::npos) {
100 newpos = str.find(delim, pos);
102 words.push_back(str.substr(pos, newpos - pos));
110 impl::trim(const std::string& str)
112 std::string::size_type pos1 = str.find_first_not_of(" \t");
113 std::string::size_type pos2 = str.find_last_not_of(" \t");
118 return str.substr(0, str.length() - pos2);
120 return str.substr(pos1);
122 return str.substr(pos1, pos2 - pos1 + 1);
126 impl::to_bool(const std::string& str)
130 atf_error_t err = atf_text_to_bool(str.c_str(), &b);
138 impl::to_bytes(std::string str)
140 if (str.empty())
143 const char unit = str[str.length() - 1];
157 str.erase(str.length() - 1);
159 return to_type< int64_t >(str) * multiplier;