Lines Matching defs:string
63 using std::string;
79 /// @return a constant string (doesn't have to be free-ed by the
276 /// Get the elapsed time as a human-readable string.
278 /// @return the elapsed time as a human-readable string.
279 string
310 /// Emit a string representing the elapsed time (in a human-readable
313 /// @param o the output stream to emit the elapsed time string to.
335 get_stat(const string& path,
345 file_exists(const string& path)
358 dir_exists(const string &path)
365 dir_is_empty(const string &path)
391 is_regular_file(const string& path)
401 string symlink_target_path;
416 dir_contains_ctf_archive(const string& directory,
417 const string& archive_prefix)
419 string ctf_archive = directory + "/" + archive_prefix + ".ctfa";
440 file_has_dwarf_debug_info(const string& elf_file_path,
476 file_has_ctf_debug_info(const string& elf_file_path,
490 string vmlinux;
493 string dirname;
514 is_dir(const string& path)
524 string symlink_target_path;
597 decl_names_equal(const string& l, const string& r)
599 string::size_type l_pos1 = 0, r_pos1 = 0;
600 const string::size_type l_length = l.length(), r_length = r.length();
604 string::size_type l_pos2 = l.find("::", l_pos1);
605 string::size_type r_pos2 = r.find("::", r_pos1);
606 if (l_pos2 == string::npos)
608 if (r_pos2 == string::npos)
653 maybe_get_symlink_target_file_path(const string& file_path,
654 string& target_path)
687 dir_name(string const& path,
688 string& dir_name,
716 base_name(string const &path,
717 string& file_name)
741 real_path(const string&path, string& result)
763 ensure_dir_path_created(const string& dir_path)
779 string cmd;
793 ensure_parent_dir_created(const string& path)
800 string parent;
810 /// The prefix is a string which looks like:
819 emit_prefix(const string& prog_name, ostream& out)
834 check_file(const string& path, ostream& out, const string& prog_name)
862 check_dir(const string& path, ostream& out, const string& prog_name)
879 /// Test if a given string ends with a particular suffix.
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();
896 /// Test if a given string begins with a particular prefix.
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)
912 string::size_type prefix_len = prefix.length();
919 /// Test if a string is made of ascii characters.
921 /// @param str the string to consider.
925 string_is_ascii(const string& str)
927 for (string::const_iterator i = str.begin(); i != str.end(); ++i)
934 /// Test if a string is made of ascii characters which are identifiers
941 /// string literal corresponds to a control character (in either of
945 /// @param str the string to consider.
950 string_is_ascii_identifier(const string& str)
952 for (string::const_iterator i = str.begin(); i != str.end(); ++i)
965 /// Split a given string into substrings, given some delimiters.
967 /// @param input_string the input string to split.
969 /// @param delims a string containing the delimiters to consider.
973 /// @return true iff the function found delimiters in the input string
975 /// in the input string, then the input string is added at the end of
978 split_string(const string& input_string,
979 const string& delims,
980 vector<string>& result)
995 if (next == string::npos)
997 string s = input_string.substr(current);
1003 string s = input_string.substr(current, next - current);
1011 while (next != string::npos);
1016 /// Get the suffix of a string, given a prefix to consider.
1018 /// @param input_string the input string to consider.
1020 /// @param prefix the prefix of the input string to consider.
1026 /// @p suffix in the input string @p input_string.
1028 string_suffix(const string& input_string,
1029 const string& prefix,
1030 string& suffix)
1037 // The input string does not start with the string contained in
1047 /// @param s1 the first input string to consider.
1049 /// @param s2 the second input string to consider.
1058 common_prefix(const string& s1, const string& s2, string &result)
1087 sorted_strings_common_prefix(vector<string>& input_strings, string& prefix)
1089 string prefix_candidate;
1100 string cur_str;
1101 for (vector<string>::const_iterator i = input_strings.begin();
1112 string s;
1130 /// Return the version string of the library.
1132 /// @return the version string of the library.
1133 string
1136 string major, minor, revision, version_string, suffix;
1142 /// Return the version string for the ABIXML format.
1144 /// @return the version string of the ABIXML format.
1145 string
1148 string major, minor, version_string;
1165 execute_command_and_get_output(const string& cmd, vector<string>& lines)
1178 string result;
1212 get_dsos_provided_by_rpm(const string& rpm_path, set<string>& provided_dsos)
1214 vector<string> query_output;
1223 for (vector<string>::const_iterator line = query_output.begin();
1227 string dso = line->substr(0, line->find('('));
1235 /// Remove spaces at the beginning and at the end of a given string.
1237 /// @param str the input string to consider.
1239 /// @return the @p str string with leading and trailing white spaces removed.
1240 string
1241 trim_white_space(const string& str)
1246 string result;
1247 string::size_type start, end;
1260 /// Remove a string of pattern in front of a given string.
1262 /// For instance, consider this string:
1266 /// sub-string "foo". Thus, the call:
1268 /// will return the string "foo".
1270 /// @param from the string to trim the leading repetition of pattern from.
1274 /// @return the resulting string where the leading patter @p to_trim
1276 string
1277 trim_leading_string(const string& from, const string& to_trim)
1279 string str = from;
1412 /// Get a pseudo random number as string.
1414 /// @return a pseudo random number as string.
1415 string
1428 string repr;
1588 guess_file_type(const string& file_path)
1618 /// @param str the string containing the .deb NVR.
1626 get_deb_name(const string& str, string& name)
1631 string::size_type str_len = str.length(), i = 0 ;
1648 /// @param str the string containing the NVR of the rpm.
1656 get_rpm_name(const string& str, string& name)
1661 string::size_type str_len = str.length(), i = 0;
1662 string::value_type c;
1667 string::size_type next_index = i + 1;
1680 /// Get the architecture string from the NVR of an rpm.
1685 /// archirecture string iff the function returns true.
1687 /// @return true iff the function could find the architecture string
1690 get_rpm_arch(const string& str, string& arch)
1698 string::size_type str_len = str.length(), i = 0;
1699 string::value_type c;
1700 string::size_type last_dot_index = 0, dot_before_last_index = 0;
1743 file_is_kernel_package(const string& file_name, file_type file_type)
1746 string package_name;
1773 file_is_kernel_debuginfo_package(const string& file_name, file_type file_type)
1776 string package_name;
1827 string s = string(pwd.get()) + "/" + p;
1855 string s = string(pwd) + "/" + p;
1881 handle_file_entry(const string& file_path,
1924 string fname = entry->fts_name;
1948 gen_suppr_spec_from_headers_root_dir(const string& headers_root_dir,
1980 gen_suppr_spec_from_headers(const vector<string>& headers_root_dirs,
1981 const vector<string>& header_files)
1985 for (vector<string>::const_iterator root_dir = headers_root_dirs.begin();
1990 for (vector<string>::const_iterator file = header_files.begin();
2012 gen_suppr_spec_from_headers(const string& headers_root_dir,
2013 const vector<string>& header_files)
2016 vector<string> root_dirs;
2034 gen_suppr_spec_from_headers(const string& headers_root_dir)
2037 vector<string> header_files;
2045 /// one section. The name of the section is a string that ends up
2046 /// with the sub-string "whitelist". For instance
2068 (const std::vector<std::string>& abi_whitelist_paths)
2071 std::vector<std::string> whitelisted_names;
2072 for (std::vector<std::string>::const_iterator
2092 std::string section_name = (*section_iter)->get_name();
2105 const std::string& name = prop->get_name();
2124 const std::string regex = regex::generate_from_strings(whitelisted_names);
2154 string
2157 string default_system_suppr_path;
2165 get_system_libdir() + string("/libabigail/default.abignore");
2173 string
2176 string default_user_suppr_path;
2206 string default_system_suppr_path =
2222 string default_user_suppr_path =
2238 const string& fname)
2246 string fpath = ::basename(entry->fts_path);
2263 find_file_under_dir(const string& root_dir,
2264 const string& file_path_to_look_for,
2265 string& result)
2314 vector<string>& suppr_paths,
2315 vector<string>& kabi_whitelist_paths,
2320 for (vector<string>::const_iterator i = suppr_paths.begin();
2349 string fname = entry->fts_name;
2353 string dirname;
2379 string fname = entry->fts_name;
2401 find_vmlinux_and_module_paths(const string& from,
2402 string &vmlinux_path,
2403 vector<string> &module_paths)
2444 find_vmlinux_path(const string& from,
2445 string &vmlinux_path)
2494 get_binary_paths_from_kernel_dist(const string& dist_root,
2495 const string& debug_info_root_path,
2496 string& vmlinux_path,
2497 vector<string>& module_paths)
2510 string kernel_modules_root;
2511 string debug_info_root;
2525 string from = dist_root;
2544 get_vmlinux_path_from_kernel_dist(const string& from,
2545 string& vmlinux_path)
2556 string dist_root = from;
2580 get_binary_paths_from_kernel_dist(const string& dist_root,
2581 string& vmlinux_path,
2582 vector<string>& module_paths)
2584 string debug_info_root_path;
2631 const string& vmlinux,
2632 vector<string>& modules,
2633 const string& root,
2635 vector<string>& suppr_paths,
2636 vector<string>& kabi_wl_paths,
2679 for (vector<string>::const_iterator m = modules.begin();
2748 build_corpus_group_from_kernel_dist_under(const string& root,
2749 const string debug_info_root,
2750 const string& vmlinux_path,
2751 vector<string>& suppr_paths,
2752 vector<string>& kabi_wl_paths,
2758 string vmlinux = vmlinux_path;
2760 vector<string> modules;
2837 create_best_elf_based_reader(const string& elf_file_path,
2887 /// each string represent one of the functions in the two sequences of