Files
MagicSetEditor2/src/data/format/mse2.cpp
T
twanvl 95a5c2f42b fixed update ui for NewWindow
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@106 0fc631ac-6414-0410-93d0-97cfa31319b6
2006-12-10 16:47:56 +00:00

38 lines
1.4 KiB
C++

//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <data/format/formats.hpp>
#include <data/set.hpp>
#include <data/settings.hpp>
// ----------------------------------------------------------------------------- : MSE2FileFormat
/// The file format of MSE2 files
class MSE2FileFormat : public FileFormat {
public:
virtual String extension() { return _("mse-set"); }
virtual String name() { return _("Magic Set Editor sets (*.mse-set)"); }
virtual bool canImport() { return true; }
virtual bool canExport(const Game&) { return true; }
virtual SetP importSet(const String& filename) {
settings.addRecentFile(filename);
SetP set(new Set);
set->open(filename);
return set;
}
virtual void exportSet(Set& set, const String& filename) {
settings.addRecentFile(filename);
set.saveAs(filename);
set.actions.setSavePoint();;
}
};
FileFormatP mse2_file_format() {
return new_shared<MSE2FileFormat>();
}