2
* The contents of this file are subject to the Initial
3
* Developer's Public License Version 1.0 (the "License");
4
* you may not use this file except in compliance with the
5
* License. You may obtain a copy of the License at
6
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
8
* Software distributed under the License is distributed AS IS,
9
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
10
* See the License for the specific language governing rights
11
* and limitations under the License.
13
* The Original Code was created by Dmitry Yemanov
14
* for the Firebird Open Source RDBMS project.
16
* Copyright (c) 2006 Dmitry Yemanov <dimitr@users.sf.net>
17
* and all contributors signed below.
19
* All Rights Reserved.
20
* Contributor(s): ______________________________________.
23
#ifndef CLASSES_TEMP_FILE_H
24
#define CLASSES_TEMP_FILE_H
27
#include "../common/classes/fb_string.h"
28
#include "../common/classes/File.h"
30
class TempFile : public Firebird::File {
32
TempFile(MemoryPool& pool,
33
const Firebird::PathName& prefix,
34
const Firebird::PathName& directory,
35
bool do_unlink = true)
36
: filename(pool), position(0), size(0), doUnlink(do_unlink)
38
init(directory, prefix);
41
TempFile(const Firebird::PathName& prefix,
42
bool do_unlink = true)
43
: position(0), size(0), doUnlink(do_unlink)
50
size_t read(offset_t, void*, size_t);
51
size_t write(offset_t, void*, size_t);
55
offset_t getSize() const
62
const Firebird::PathName& getName() const
67
static Firebird::PathName getTempPath();
68
static Firebird::PathName create(const Firebird::PathName&);
71
void init(const Firebird::PathName&, const Firebird::PathName&);
80
Firebird::PathName filename;
86
#endif // CLASSES_TEMP_FILE_H