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
This commit is contained in:
Tim Mayberry 2007-05-18 02:45:08 +00:00
parent 1ca0e752fd
commit 1dd429ac35
2 changed files with 9 additions and 6 deletions

View file

@ -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;
}

View file

@ -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);
}