bool execute_command_and_get_output(const string&, vector<string>&);
bool get_dsos_provided_by_rpm(const string& rpm_path,
set<string>& provided_dsos);
-string remove_trailing_white_spaces(const string&);
+string trim_white_space(const string&);
suppr::type_suppression_sptr
gen_suppr_spec_from_headers(const string& hdrs_root_dir);
char_is_white_space(int b)
{return b == ' ' || b == '\t' || b == '\n';}
-/// Remove the trailing spaces at the begining and at the end of a
-/// given string.
+/// Remove the spaces at the begining and at the end of a given string.
///
-/// @param str the string to remove trailing white spaces from.
+/// @param str the string to remove leading and trailing white spaces from.
///
-/// @return the string resulting from the removal of trailing white
-/// space from @p str.
+/// @return the string resulting from the removal of white space from @p str.
static string
-remove_trailing_white_spaces(const string& str)
+trim_white_space(const string& str)
{
string result;
assert(read_next_char(c));
v += c;
}
- string result = remove_trailing_white_spaces(v);
- return result;
+ return trim_white_space(v);
}
/// Read a string property value.
++line)
{
string dso = line->substr(0, line->find('('));
- dso = remove_trailing_white_spaces(dso);
+ dso = trim_white_space(dso);
if (!dso.empty())
provided_dsos.insert(dso);
}
///
/// @param str the input string to consider.
///
-/// @return the @p str string from which trailing white spaces have
-/// been removed.
+/// @return the @p str string with leading and trailing white spaces removed.
string
-remove_trailing_white_spaces(const string& str)
+trim_white_space(const string& str)
{
if (str.empty())
return "";