From e16dc041ec7dbcc83c64533ee4cf8759f6ae0be5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 28 Sep 2009 18:49:51 -0700 Subject: Simplify copy_file calls Every single copy_file call we had was converting strings to char*, printing the same error message, and optionally printing the same verbose string. Let's canonicalize that. * util.cxx (copy_file): Take string filenames, add a verbose flag, and consolidate the message printing. * cache.cxx (add_to_cache): Pass strings and remove message printing. (get_from_cache): Ditto. * main.cxx (main): Ditto. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto. --- util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util.h') diff --git a/util.h b/util.h index 24845545..1252d559 100644 --- a/util.h +++ b/util.h @@ -8,7 +8,8 @@ const char *get_home_directory(void); size_t get_file_size(const std::string &path); bool file_exists (const std::string &path); -int copy_file(const char *src, const char *dest); +bool copy_file(const std::string& src, const std::string& dest, + bool verbose=false); int create_dir(const char *dir); int remove_file_or_dir(const char *dir); void tokenize(const std::string& str, std::vector& tokens, -- cgit