diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2007-05-18 02:45:08 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2007-05-18 02:45:08 +0000 |
commit | 1dd429ac358a928eba56f5e54ab86ccf450fbc61 (patch) | |
tree | 539d70a229bf8636779e8d02f6d51a3feaaab803 /libs/pbd | |
parent | 1ca0e752fd1eacf2bf51afba00fef971e0ea05ee (diff) |
Change return type of PBD::copy_file to boolean to indicate success/failure
git-svn-id: svn://localhost/ardour2/trunk@1866 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/copyfile.cc | 10 | ||||
-rw-r--r-- | libs/pbd/pbd/copyfile.h | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/libs/pbd/copyfile.cc b/libs/pbd/copyfile.cc index 2284a6b26d..b4a654dbe8 100644 --- a/libs/pbd/copyfile.cc +++ b/libs/pbd/copyfile.cc @@ -29,7 +29,7 @@ using namespace PBD; using namespace std; -int +bool PBD::copy_file (Glib::ustring from, Glib::ustring to) { ifstream in (from.c_str()); @@ -37,12 +37,12 @@ PBD::copy_file (Glib::ustring from, Glib::ustring to) if (!in) { error << string_compose (_("Could not open %1 for copy"), from) << endmsg; - return -1; + return false; } if (!out) { error << string_compose (_("Could not open %1 as copy"), to) << endmsg; - return -1; + return false; } out << in.rdbuf(); @@ -50,8 +50,8 @@ PBD::copy_file (Glib::ustring from, Glib::ustring to) if (!in || !out) { error << string_compose (_("Could not copy existing file %1 to %2"), from, to) << endmsg; unlink (to.c_str()); - return -1; + return false; } - return 0; + return true; } diff --git a/libs/pbd/pbd/copyfile.h b/libs/pbd/pbd/copyfile.h index 1e8c5c2a42..f233d68d87 100644 --- a/libs/pbd/pbd/copyfile.h +++ b/libs/pbd/pbd/copyfile.h @@ -21,5 +21,8 @@ namespace PBD { - int copy_file (Glib::ustring from, Glib::ustring to); + /** + * @return true if file was successfully copied + */ + bool copy_file (Glib::ustring from, Glib::ustring to); } |