1 | // Aseprite |
---|---|
2 | // Copyright (C) 2022 Igara Studio S.A. |
3 | // Copyright (C) 2001-2018 David Capello |
4 | // |
5 | // This program is distributed under the terms of |
6 | // the End-User License Agreement for Aseprite. |
7 | |
8 | #ifdef HAVE_CONFIG_H |
9 | #include "config.h" |
10 | #endif |
11 | |
12 | #include "app/drm.h" |
13 | #include "app/file/file_format.h" |
14 | #include "app/file/format_options.h" |
15 | |
16 | #include <algorithm> |
17 | |
18 | namespace app { |
19 | |
20 | FileFormat::FileFormat() |
21 | { |
22 | } |
23 | |
24 | FileFormat::~FileFormat() |
25 | { |
26 | } |
27 | |
28 | const char* FileFormat::name() const |
29 | { |
30 | return onGetName(); |
31 | } |
32 | |
33 | void FileFormat::getExtensions(base::paths& exts) const |
34 | { |
35 | onGetExtensions(exts); |
36 | } |
37 | |
38 | dio::FileFormat FileFormat::dioFormat() const |
39 | { |
40 | return onGetDioFormat(); |
41 | } |
42 | |
43 | bool FileFormat::load(FileOp* fop) |
44 | { |
45 | ASSERT(support(FILE_SUPPORT_LOAD)); |
46 | return onLoad(fop); |
47 | } |
48 | |
49 | #ifdef ENABLE_SAVE |
50 | bool FileFormat::save(FileOp* fop) |
51 | { |
52 | DRM_INVALID return false; |
53 | |
54 | ASSERT(support(FILE_SUPPORT_SAVE)); |
55 | return onSave(fop); |
56 | } |
57 | #endif |
58 | |
59 | bool FileFormat::postLoad(FileOp* fop) |
60 | { |
61 | return onPostLoad(fop); |
62 | } |
63 | |
64 | } // namespace app |
65 |