Lines Matching refs:str
46 impl::duplicate(const char* str)
48 char* copy = new char[std::strlen(str) + 1];
49 std::strcpy(copy, str);
54 impl::match(const std::string& str, const std::string& regex)
60 found = str.empty();
68 const int res = ::regexec(&preg, str.c_str(), 0, NULL, 0);
80 impl::to_lower(const std::string& str)
83 for (std::string::const_iterator iter = str.begin(); iter != str.end();
90 impl::split(const std::string& str, const std::string& delim)
95 while (pos < str.length() && newpos != std::string::npos) {
96 newpos = str.find(delim, pos);
98 words.push_back(str.substr(pos, newpos - pos));
106 impl::trim(const std::string& str)
108 std::string::size_type pos1 = str.find_first_not_of(" \t");
109 std::string::size_type pos2 = str.find_last_not_of(" \t");
114 return str.substr(0, str.length() - pos2);
116 return str.substr(pos1);
118 return str.substr(pos1, pos2 - pos1 + 1);
122 impl::to_bool(const std::string& str)
126 atf_error_t err = atf_text_to_bool(str.c_str(), &b);
134 impl::to_bytes(std::string str)
136 if (str.empty())
139 const char unit = str[str.length() - 1];
153 str.erase(str.length() - 1);
155 return to_type< int64_t >(str) * multiplier;