mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Make extension optional in --export command.
Added add_extension function Added ExportTemplate::byName Use ExportTemplate::byName in main
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <data/game.hpp>
|
||||
#include <data/set.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <util/io/package_manager.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Export template, basics
|
||||
|
||||
@@ -19,6 +20,10 @@ ExportTemplate::ExportTemplate()
|
||||
, create_directory(false)
|
||||
{}
|
||||
|
||||
ExportTemplateP ExportTemplate::byName(const String& name) {
|
||||
return package_manager.open<ExportTemplate>(add_extension(name, _(".mse-export-template")));
|
||||
}
|
||||
|
||||
String ExportTemplate::typeNameStatic() { return _("export-template"); }
|
||||
String ExportTemplate::typeName() const { return _("export-template"); }
|
||||
Version ExportTemplate::fileVersion() const { return file_version_export_template; }
|
||||
|
||||
@@ -24,7 +24,7 @@ DECLARE_POINTER_TYPE(Package);
|
||||
|
||||
/// A template for exporting sets to HTML or text format
|
||||
class ExportTemplate : public Packaged {
|
||||
public:
|
||||
public:
|
||||
ExportTemplate();
|
||||
|
||||
GameP game; ///< Game this template is for
|
||||
@@ -38,7 +38,9 @@ class ExportTemplate : public Packaged {
|
||||
virtual String typeName() const;
|
||||
Version fileVersion() const;
|
||||
virtual void validate(Version = app_version);
|
||||
private:
|
||||
/// Loads the export template with a particular name
|
||||
static ExportTemplateP byName(const String & name);
|
||||
private:
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user