Incremented version number to 0.3.7

When saving files an older version number is used if that version of MSE would be able to open the set

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1011 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-06-28 16:31:40 +00:00
parent c0669fb658
commit 64b7912835
26 changed files with 60 additions and 28 deletions
-2
View File
@@ -30,7 +30,6 @@ class GetDefaultMember {
inline bool isComplex() const { return false; }
inline void addAlias(int, const Char*, const Char*) {}
inline void handleIgnore(int, const Char*) {}
inline void handleAppVersion() {} // no effect
/// The result, or script_nil if the member was not found
inline ScriptValueP result() { return value; }
@@ -78,7 +77,6 @@ class GetMember : private GetDefaultMember {
inline bool isComplex() const { return false; }
inline void addAlias(int, const Char*, const Char*) {}
inline void handleIgnore(int, const Char*) {}
inline void handleAppVersion() {} // no effect
/// The result, or script_nil if the member was not found
inline ScriptValueP result() { return gdm.result(); }
+3 -2
View File
@@ -530,13 +530,13 @@ void Packaged::loadFully() {
void Packaged::save() {
WITH_DYNAMIC_ARG(writing_package, this);
writeFile(typeName(), *this);
writeFile(typeName(), *this, fileVersion());
referenceFile(typeName());
Package::save();
}
void Packaged::saveAs(const String& package, bool remove_unused) {
WITH_DYNAMIC_ARG(writing_package, this);
writeFile(typeName(), *this);
writeFile(typeName(), *this, fileVersion());
referenceFile(typeName());
Package::saveAs(package, remove_unused);
}
@@ -574,6 +574,7 @@ void Packaged::requireDependency(Packaged* package) {
// ----------------------------------------------------------------------------- : IncludePackage
String IncludePackage::typeName() const { return _("include"); }
Version IncludePackage::fileVersion() const { return file_version_script; }
IMPLEMENT_REFLECTION(IncludePackage) {
REFLECT_BASE(Packaged);
+5 -2
View File
@@ -133,8 +133,8 @@ class Package : public IntrusivePtrVirtualBase {
}
template <typename T>
void writeFile(const String& file, const T& obj) {
Writer writer(openOut(file));
void writeFile(const String& file, const T& obj, Version file_version) {
Writer writer(openOut(file), file_version);
writer.handle(obj);
}
@@ -229,6 +229,8 @@ class Packaged : public Package {
virtual String typeName() const = 0;
/// Can be overloaded to do validation after loading
virtual void validate(Version file_app_version);
/// What file version should be used for writing files?
virtual Version fileVersion() const = 0;
DECLARE_REFLECTION_VIRTUAL();
@@ -244,6 +246,7 @@ class Packaged : public Package {
class IncludePackage : public Packaged {
protected:
String typeName() const;
Version fileVersion() const;
DECLARE_REFLECTION();
};
+1 -1
View File
@@ -310,7 +310,7 @@ void PackageDirectory::loadDatabase() {
}
void PackageDirectory::saveDatabase() {
Writer writer(new_shared1<wxFileOutputStream>(databaseFile()));
Writer writer(new_shared1<wxFileOutputStream>(databaseFile()), app_version);
writer.handle(*this);
}
String PackageDirectory::databaseFile() {
+2 -5
View File
@@ -15,18 +15,15 @@
// ----------------------------------------------------------------------------- : Writer
Writer::Writer(const OutputStreamP& output)
Writer::Writer(const OutputStreamP& output, Version file_app_version)
: indentation(0), just_opened(false)
, output(output), stream(*output)
{
stream.WriteString(BYTE_ORDER_MARK);
handleAppVersion();
handle(_("mse_version"), file_app_version);
}
void Writer::handleAppVersion() {
handle(_("mse_version"), app_version);
}
void Writer::enterBlock(const Char* name) {
// indenting into a sub-block?
+1 -4
View File
@@ -26,7 +26,7 @@ typedef shared_ptr<wxOutputStream> OutputStreamP;
class Writer {
public:
/// Construct a writer that writes to the given output stream
Writer(const OutputStreamP& output);
Writer(const OutputStreamP& output, Version file_app_version);
/// Tell the reflection code we are not reading
inline bool reading() const { return false; }
@@ -35,9 +35,6 @@ class Writer {
inline void addAlias(int, const Char*, const Char*) {}
inline void handleIgnore(int, const Char*) {}
/// Write the application version
void handleAppVersion();
// --------------------------------------------------- : Handling objects
/// Handle an object: write it under the given name
template <typename T>