mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Following a fine MSE tradition of forgetting to svn add new files.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1428 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) 2001 - 2009 Twan van Laarhoven and Sean Hunt |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <util/vcs.hpp>
|
||||
#include <util/vcs/subversion.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Reflection
|
||||
|
||||
template <>
|
||||
VCSP read_new<VCS>(Reader& reader) {
|
||||
// there must be a type specified
|
||||
String type;
|
||||
reader.handle(_("type"), type);
|
||||
if (type == _("none")) return new_intrusive<VCS>();
|
||||
else if (type == _("subversion")) return new_intrusive<SubversionVCS>();
|
||||
else if (type.empty()) {
|
||||
reader.warning(_ERROR_1_("expected key", _("version control system")));
|
||||
throw ParseError(_ERROR_("aborting parsing"));
|
||||
} else {
|
||||
reader.warning(_ERROR_1_("unsupported version control type", type));
|
||||
throw ParseError(_ERROR_("aborting parsing"));
|
||||
}
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(VCS) {
|
||||
REFLECT_IF_NOT_READING {
|
||||
String type = _("none");
|
||||
REFLECT(type);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void Reader::handle(VCSP& pointer) {
|
||||
pointer = read_new<VCS>(*this);
|
||||
handle(*pointer);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
Reference in New Issue
Block a user