mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
7ea7dabed1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3554 a592a061-630c-0410-9148-cb99ea01b6c8
26 lines
431 B
C
26 lines
431 B
C
#include <config.h>
|
|
|
|
#include <fstream>
|
|
|
|
#include "support/lyxlib.h"
|
|
#include "LString.h"
|
|
|
|
using std::ifstream;
|
|
using std::ofstream;
|
|
using std::ios;
|
|
|
|
bool lyx::copy(string const & from, string const & to)
|
|
{
|
|
ifstream ifs(from.c_str());
|
|
if (!ifs)
|
|
return false;
|
|
ofstream ofs(to.c_str(),
|
|
ios::binary | ios::out | ios::trunc);
|
|
if (!ofs)
|
|
return false;
|
|
ofs << ifs.rdbuf();
|
|
if (ofs.good())
|
|
return true;
|
|
return false;
|
|
}
|