summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2011-07-27 19:00:12 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2011-07-27 19:00:12 (GMT)
commit64f0c97c3adaa28edf6f1da3264621a18c1d1adb (patch)
treee4c6389f90f951bbd01b45ad4377b0b475dd246f /src/util.cpp
parentb655037884e82e257794004d4e88d3a9ed29d5c3 (diff)
downloadDoxygen-64f0c97c3adaa28edf6f1da3264621a18c1d1adb.zip
Doxygen-64f0c97c3adaa28edf6f1da3264621a18c1d1adb.tar.gz
Doxygen-64f0c97c3adaa28edf6f1da3264621a18c1d1adb.tar.bz2
Release-1.7.4-20110727
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 3621f50..12399cc 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -7030,3 +7030,32 @@ QCString replaceColorMarkers(const char *str)
return result;
}
+bool copyFile(const QCString &src,const QCString &dest)
+{
+ QFile sf(src);
+ if (sf.open(IO_ReadOnly))
+ {
+ QFileInfo fi(src);
+ QFile df(dest);
+ if (df.open(IO_WriteOnly))
+ {
+ char *buffer = new char[fi.size()];
+ sf.readBlock(buffer,fi.size());
+ df.writeBlock(buffer,fi.size());
+ df.flush();
+ delete[] buffer;
+ }
+ else
+ {
+ err("error: could not write to file %s\n",dest.data());
+ return FALSE;
+ }
+ }
+ else
+ {
+ err("error: could not open user specified file %s\n",src.data());
+ return FALSE;
+ }
+ return TRUE;
+}
+