mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-28 04:17:43 +00:00
6c300f72a2
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
43 lines
700 B
C
43 lines
700 B
C
/**
|
|
* \file copy.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include <fstream>
|
|
|
|
#include "support/lyxlib.h"
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
using std::ifstream;
|
|
using std::ofstream;
|
|
using std::ios;
|
|
using std::string;
|
|
|
|
|
|
bool lyx::support::copy(string const & from, string const & to)
|
|
{
|
|
ifstream ifs(from.c_str(), ios::binary | ios::in);
|
|
if (!ifs)
|
|
return false;
|
|
|
|
ofstream ofs(to.c_str(), ios::binary | ios::out | ios::trunc);
|
|
if (!ofs)
|
|
return false;
|
|
|
|
ofs << ifs.rdbuf();
|
|
return ofs.good();
|
|
}
|
|
|
|
|
|
} // namespace lyx
|