blob: 3e7a978def6de15e5dd8ee78db60fbda9772b0f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef _UTIL_FILE_H
#define _UTIL_FILE_H
#include "scribusapi.h"
class QDataStream;
class QString;
class ScStreamFilter;
/**
* @brief Copy a source file to a target
*
* This function copy a file to a destination. If destination exists,
* the target file is overwritten.
*
* @param source the source file
* @param target the target file
* @return true on success, false on failure.
**/
bool SCRIBUS_API copyFile(const QString& source, const QString& target);
/**
* @brief Copy a source file to a target using atomic operations
*
* This function copy a file to a destination using atomic operations.
* If destination exists, the target file is overwritten.
*
* @param source the source file
* @param target the target file
* @return true on success, false on failure.
**/
bool SCRIBUS_API copyFileAtomic(const QString& source, const QString& target);
/**
* @brief Copy a source file to a stream filter
*
* This function copy a file to a stream filter. The target filter has
* to be opened before the function call.
*
* @param source the source file
* @param target the target filter
* @return true on success, false on failre.
**/
bool SCRIBUS_API copyFileToFilter(const QString& source, ScStreamFilter& target);
/**
* @brief Copy a source file to a data stream
* @param source the source file
* @param target the target stream
* @return true on success, false on failre.
**/
bool SCRIBUS_API copyFileToStream(const QString& source, QDataStream& target);
/**
* @brief Move a source file to a destination
*
* This function move a file to a destination. The source file is deleted
* when done.
*
* @param source the source file
* @param target the target file
* @return true on success, false on failre.
**/
bool SCRIBUS_API moveFile(const QString& source, const QString& target);
#endif
|