-
Notifications
You must be signed in to change notification settings - Fork 0
/
sourceFileFormat.hpp
39 lines (33 loc) · 1.12 KB
/
sourceFileFormat.hpp
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
/**
* Factories for code which knows how to create, load and save FileFeatures.
*
* (C) 2021 Malcolm Tyrrell
*
* Licensed under the GPLv3.0. See LICENSE file.
**/
#pragma once
#include <Common/Registry/fileTypeRegistry.hpp>
#include <Common/productInfo.hpp>
#include <istream>
#include <string>
#include <vector>
namespace babelwires {
class DataSource;
struct UserLogger;
} // namespace babelwires
namespace babelwires {
class FileFeature;
struct ProjectContext;
/// Format which can create a feature by loading a file.
class SourceFileFormat : public FileTypeEntry, ProductInfo {
public:
SourceFileFormat(LongId identifier, VersionNumber version, Extensions extensions);
virtual std::unique_ptr<babelwires::FileFeature> loadFromFile(DataSource& dataSource, const ProjectContext& projectContext,
UserLogger& userLogger) const = 0;
};
/// Registry of SourceFileFormats.
class SourceFileFormatRegistry : public FileTypeRegistry<SourceFileFormat> {
public:
SourceFileFormatRegistry();
};
}