implemented import formats

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@102 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-09 23:22:33 +00:00
parent c130916465
commit a400644b25
12 changed files with 260 additions and 18 deletions
+5 -5
View File
@@ -18,9 +18,9 @@ DECLARE_TYPEOF_COLLECTION(FileFormatP);
vector<FileFormatP> file_formats;
void init_file_formats() {
//file_formats.push_back(new_shared<MSE2FileFilter>());
//file_formats.push_back(new_shared<MSE1FileFilter>());
//file_formats.push_back(new_shared<MtgEditorFileFilter>());
file_formats.push_back(mse2_file_format());
file_formats.push_back(mse1_file_format());
file_formats.push_back(mtg_editor_file_format());
}
String import_formats() {
@@ -47,7 +47,7 @@ String export_formats(const Game& game) {
return type_strings;
}
void export_set(const Set& set, const String& filename, size_t format_type) {
void export_set(Set& set, const String& filename, size_t format_type) {
FileFormatP format = file_formats.at(format_type);
if (!format->canExport(*set.game)) {
throw InternalError(_("File format doesn't apply to set"));
@@ -67,4 +67,4 @@ SetP import_set(String name) {
// default: use first format = MSE2 format
assert(!file_formats.empty() && file_formats[0]->canImport());
return file_formats[0]->importSet(name);
}
}