summaryrefslogtreecommitdiffstats
path: root/src/io/file.h
blob: 82aa7473518ef4e26997ad9383e89813255ed652 (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
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * File operations (independent of GUI)
 *
 * Copyright (C) 2018 Tavmjong Bah
 *
 * The contents of this file may be used under the GNU General Public License Version 2 or later.
 *
 */

#ifndef INK_FILE_IO_H
#define INK_FILE_IO_H

#include <string>

namespace Gio {
class File;
}

namespace Glib {
class ustring;

template <class T>
class RefPtr;
}

class SPDocument;

SPDocument* ink_file_new(const std::string &Template = "");
SPDocument* ink_file_open(const Glib::ustring &data);
SPDocument* ink_file_open(const Glib::RefPtr<Gio::File>& file, bool *cancelled = nullptr);

namespace Inkscape {
namespace IO {

class TempFilename {
    public:
        TempFilename(const std::string &pattern);
        ~TempFilename();

        std::string get_filename() const { return _filename; }
    private:
        std::string _filename;
        int _tempfd;
};

Glib::ustring find_original_file(Glib::ustring filepath, Glib::ustring name);

}}

// To do:
// ink_file_save()
// ink_file_export()
// ink_file_import()



#endif // INK_FILE_IO_H