support for saving sets

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@104 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-10 15:01:11 +00:00
parent 45d40ce49b
commit 482e6ede5b
9 changed files with 72 additions and 46 deletions
+6 -3
View File
@@ -412,7 +412,6 @@ void Packaged::open(const String& package) {
Package::open(package);
Reader reader(openIn(typeName()), absoluteFilename() + _("/") + typeName());
try {
reader.handleAppVersion();
reader.handle(*this);
validate(reader.file_app_version);
} catch (const ParseError& err) {
@@ -420,10 +419,14 @@ void Packaged::open(const String& package) {
}
}
void Packaged::save() {
// writeFile(thisT().fileName, thisT());
WITH_DYNAMIC_ARG(writing_package, this);
writeFile(typeName(), *this);
referenceFile(typeName());
Package::save();
}
void Packaged::saveAs(const String& package) {
// writeFile(thisT().fileName, thisT());
WITH_DYNAMIC_ARG(writing_package, this);
writeFile(typeName(), *this);
referenceFile(typeName());
Package::saveAs(package);
}
+2
View File
@@ -19,6 +19,7 @@ Reader::Reader(const InputStreamP& input, const String& filename)
, stream(*input)
{
moveNext();
handleAppVersion();
}
Reader::Reader(const String& filename)
@@ -28,6 +29,7 @@ Reader::Reader(const String& filename)
, stream(*input)
{
moveNext();
handleAppVersion();
}
void Reader::addAlias(Version end_version, const Char* a, const Char* b) {
+1
View File
@@ -21,6 +21,7 @@ Writer::Writer(const OutputStreamP& output)
, just_opened(false)
{
stream.WriteString(BYTE_ORDER_MARK);
handleAppVersion();
}