Lines Matching refs:str
300 return o.str();
881 /// @param str the string to consider.
885 /// @return true iff string @p str ends with suffix @p suffix.
887 string_ends_with(const string& str, const string& suffix)
889 string::size_type str_len = str.length(), suffix_len = suffix.length();
893 return str.compare(str_len - suffix_len, suffix_len, suffix) == 0;
898 /// @param str the string consider.
902 /// @return true iff string @p str begins with prefix @p prefix.
904 string_begins_with(const string& str, const string& prefix)
906 if (str.empty())
913 if (prefix_len > str.length())
916 return str.compare(0, prefix.length(), prefix) == 0;
921 /// @param str the string to consider.
923 /// @return true iff @p str is made of ascii characters.
925 string_is_ascii(const string& str)
927 for (string::const_iterator i = str.begin(); i != str.end(); ++i)
945 /// @param str the string to consider.
947 /// @return true iff @p str is made of ascii characters, and is an
950 string_is_ascii_identifier(const string& str)
952 for (string::const_iterator i = str.begin(); i != str.end(); ++i)
1237 /// @param str the input string to consider.
1239 /// @return the @p str string with leading and trailing white spaces removed.
1241 trim_white_space(const string& str)
1243 if (str.empty())
1248 for (start = 0; start < str.length(); ++start)
1249 if (!isspace(str[start]))
1252 for (end = str.length() - 1; end > 0; --end)
1253 if (!isspace(str[end]))
1256 result = str.substr(start, end - start + 1);
1279 string str = from;
1281 while (string_begins_with(str, to_trim))
1282 string_suffix(str, to_trim, str);
1283 return str;
1421 return o.str();
1618 /// @param str the string containing the .deb NVR.
1626 get_deb_name(const string& str, string& name)
1628 if (str.empty() || str[0] == '_')
1631 string::size_type str_len = str.length(), i = 0 ;
1635 if (str[i] == '_')
1642 name = str.substr(0, i);
1648 /// @param str the string containing the NVR of the rpm.
1656 get_rpm_name(const string& str, string& name)
1658 if (str.empty() || str[0] == '-')
1661 string::size_type str_len = str.length(), i = 0;
1666 c = str[i];
1668 if ((next_index < str_len) && c == '-' && isdigit(str[next_index]))
1675 name = str.substr(0, i);
1682 /// @param str the NVR to consider.
1690 get_rpm_arch(const string& str, string& arch)
1692 if (str.empty())
1695 if (!string_ends_with(str, ".rpm"))
1698 string::size_type str_len = str.length(), i = 0;
1704 c = str[i];
1717 c = str[i];
1728 arch = str.substr(dot_before_last_index + 1,