From dc0e9a513ecd97133073885c113435d87f1d95d6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 20 Aug 2012 00:02:32 +0200 Subject: [PATCH] Changed: #1440 Parse function instead of serialized handler --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/max/class_data.cpp | 30 ++++--- code/nel/tools/pipeline/max/class_data.h | 6 +- .../tools/pipeline/max/class_directory_3.cpp | 30 ++++--- .../tools/pipeline/max/class_directory_3.h | 6 +- code/nel/tools/pipeline/max/config.cpp | 90 ++++++++++++------- code/nel/tools/pipeline/max/config.h | 18 ++-- code/nel/tools/pipeline/max/dll_directory.cpp | 32 ++++--- code/nel/tools/pipeline/max/dll_directory.h | 6 +- code/nel/tools/pipeline/max/scene.cpp | 43 ++++++--- code/nel/tools/pipeline/max/scene.h | 9 +- .../nel/tools/pipeline/max/storage_object.cpp | 31 +++++-- code/nel/tools/pipeline/max/storage_object.h | 25 ++++-- 12 files changed, 224 insertions(+), 102 deletions(-) diff --git a/code/nel/tools/pipeline/max/class_data.cpp b/code/nel/tools/pipeline/max/class_data.cpp index fe00d531a..c8dfc5b01 100644 --- a/code/nel/tools/pipeline/max/class_data.cpp +++ b/code/nel/tools/pipeline/max/class_data.cpp @@ -65,6 +65,16 @@ void CClassData::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CClassData::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CClassData::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CClassData::createChunkById(uint16 id, bool container) { if (container) @@ -78,11 +88,6 @@ IStorageObject *CClassData::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CClassData::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -107,6 +112,16 @@ void CClassDataEntry::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CClassDataEntry::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CClassDataEntry::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CClassDataEntry::createChunkById(uint16 id, bool container) { if (!container) @@ -125,11 +140,6 @@ IStorageObject *CClassDataEntry::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CClassDataEntry::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max/class_data.h b/code/nel/tools/pipeline/max/class_data.h index cda06e060..4d729ec7c 100644 --- a/code/nel/tools/pipeline/max/class_data.h +++ b/code/nel/tools/pipeline/max/class_data.h @@ -56,10 +56,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CClassData */ @@ -78,10 +79,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CClassDataEntry */ diff --git a/code/nel/tools/pipeline/max/class_directory_3.cpp b/code/nel/tools/pipeline/max/class_directory_3.cpp index a2ee17655..840bb1abf 100644 --- a/code/nel/tools/pipeline/max/class_directory_3.cpp +++ b/code/nel/tools/pipeline/max/class_directory_3.cpp @@ -65,6 +65,16 @@ void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CClassDirectory3::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CClassDirectory3::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CClassDirectory3::createChunkById(uint16 id, bool container) { if (container) @@ -78,11 +88,6 @@ IStorageObject *CClassDirectory3::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CClassDirectory3::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -107,6 +112,16 @@ void CClassEntry::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CClassEntry::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CClassEntry::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CClassEntry::createChunkById(uint16 id, bool container) { if (!container) @@ -122,11 +137,6 @@ IStorageObject *CClassEntry::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CClassEntry::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max/class_directory_3.h b/code/nel/tools/pipeline/max/class_directory_3.h index f2e396dbb..425cbecbd 100644 --- a/code/nel/tools/pipeline/max/class_directory_3.h +++ b/code/nel/tools/pipeline/max/class_directory_3.h @@ -56,10 +56,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CClassDirectory3 */ @@ -78,10 +79,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CClassEntry */ diff --git a/code/nel/tools/pipeline/max/config.cpp b/code/nel/tools/pipeline/max/config.cpp index 282e6003b..f0dae74f4 100644 --- a/code/nel/tools/pipeline/max/config.cpp +++ b/code/nel/tools/pipeline/max/config.cpp @@ -66,6 +66,16 @@ void CConfig::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CConfig::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfig::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfig::createChunkById(uint16 id, bool container) { if (container) @@ -89,11 +99,6 @@ IStorageObject *CConfig::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CConfig::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -118,6 +123,16 @@ void CConfig20a0::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CConfig20a0::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfig20a0::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfig20a0::createChunkById(uint16 id, bool container) { if (container) @@ -139,11 +154,6 @@ IStorageObject *CConfig20a0::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CConfig20a0::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -168,6 +178,16 @@ void CConfig20a0Entry::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CConfig20a0Entry::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfig20a0Entry::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfig20a0Entry::createChunkById(uint16 id, bool container) { if (container) @@ -216,11 +236,6 @@ IStorageObject *CConfig20a0Entry::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CConfig20a0Entry::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -245,6 +260,16 @@ void CConfigScript::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CConfigScript::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfigScript::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfigScript::createChunkById(uint16 id, bool container) { if (container) @@ -258,11 +283,6 @@ IStorageObject *CConfigScript::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CConfigScript::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -287,6 +307,16 @@ void CConfigScriptEntry::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CConfigScriptEntry::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfigScriptEntry::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfigScriptEntry::createChunkById(uint16 id, bool container) { if (container) @@ -308,11 +338,6 @@ IStorageObject *CConfigScriptEntry::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CConfigScriptEntry::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -370,6 +395,16 @@ void CConfigScriptMetaContainer::toString(std::ostream &ostream, const std::stri CStorageContainer::toString(ostream, pad); } +void CConfigScriptMetaContainer::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CConfigScriptMetaContainer::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CConfigScriptMetaContainer::createChunkById(uint16 id, bool container) { if (container) @@ -405,11 +440,6 @@ IStorageObject *CConfigScriptMetaContainer::createChunkById(uint16 id, bool cont return CStorageContainer::createChunkById(id, container); } -void CConfigScriptMetaContainer::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max/config.h b/code/nel/tools/pipeline/max/config.h index e92f257ef..7d94b04bc 100644 --- a/code/nel/tools/pipeline/max/config.h +++ b/code/nel/tools/pipeline/max/config.h @@ -56,10 +56,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfig */ @@ -78,10 +79,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfig20a0 */ @@ -100,10 +102,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfig20a0Entry */ @@ -122,10 +125,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfigScript */ @@ -144,10 +148,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfigScriptEntry */ @@ -190,10 +195,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CConfigScriptMetaContainer */ diff --git a/code/nel/tools/pipeline/max/dll_directory.cpp b/code/nel/tools/pipeline/max/dll_directory.cpp index 21917e718..4c403460f 100644 --- a/code/nel/tools/pipeline/max/dll_directory.cpp +++ b/code/nel/tools/pipeline/max/dll_directory.cpp @@ -61,6 +61,16 @@ void CDllDirectory::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CDllDirectory::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CDllDirectory::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CDllDirectory::createChunkById(uint16 id, bool container) { if (container) @@ -75,18 +85,13 @@ IStorageObject *CDllDirectory::createChunkById(uint16 id, bool container) { switch (id) { - case 0x21C0: // FileVersion + case 0x21C0: // DllDirectoryHeader return new CStorageValue(); } } return CStorageContainer::createChunkById(id, container); } -void CDllDirectory::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - CDllEntry::CDllEntry() { @@ -107,6 +112,16 @@ void CDllEntry::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CDllEntry::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CDllEntry::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CDllEntry::createChunkById(uint16 id, bool container) { if (!container) @@ -121,11 +136,6 @@ IStorageObject *CDllEntry::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CDllEntry::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/dll_directory.h b/code/nel/tools/pipeline/max/dll_directory.h index 12d7db959..e8ffc4500 100644 --- a/code/nel/tools/pipeline/max/dll_directory.h +++ b/code/nel/tools/pipeline/max/dll_directory.h @@ -55,10 +55,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CDllDirectory */ @@ -77,10 +78,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CDllDirectory */ diff --git a/code/nel/tools/pipeline/max/scene.cpp b/code/nel/tools/pipeline/max/scene.cpp index c4f8e4859..92f77bf10 100644 --- a/code/nel/tools/pipeline/max/scene.cpp +++ b/code/nel/tools/pipeline/max/scene.cpp @@ -66,6 +66,16 @@ void CScene::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } +void CScene::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CScene::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CScene::createChunkById(uint16 id, bool container) { if (container) @@ -76,11 +86,6 @@ IStorageObject *CScene::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CScene::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -105,6 +110,16 @@ void CSceneClassContainer::toString(std::ostream &ostream, const std::string &pa CStorageContainer::toString(ostream, pad); } +void CSceneClassContainer::parse(uint16 version, TParseLevel level) +{ + CStorageContainer::parse(version, level); +} + +void CSceneClassContainer::build(uint16 version) +{ + CStorageContainer::build(version); +} + IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container) { if (container) @@ -116,11 +131,6 @@ IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -void CSceneClassContainer::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - CStorageContainer::serialized(soit, container); -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -145,14 +155,19 @@ void CSceneClass::toString(std::ostream &ostream, const std::string &pad) CStorageContainer::toString(ostream, pad); } -IStorageObject *CSceneClass::createChunkById(uint16 id, bool container) +void CSceneClass::parse(uint16 version, TParseLevel level) { - return CStorageContainer::createChunkById(id, container); + CStorageContainer::parse(version, level); +} + +void CSceneClass::build(uint16 version) +{ + CStorageContainer::build(version); } -void CSceneClass::serialized(TStorageObjectContainer::iterator soit, bool container) +IStorageObject *CSceneClass::createChunkById(uint16 id, bool container) { - CStorageContainer::serialized(soit, container); + return CStorageContainer::createChunkById(id, container); } const ucchar *CSceneClass::DisplayName = ucstring("Unknown Scene Class").c_str(); diff --git a/code/nel/tools/pipeline/max/scene.h b/code/nel/tools/pipeline/max/scene.h index 9f4f2e6c8..83ccfed8f 100644 --- a/code/nel/tools/pipeline/max/scene.h +++ b/code/nel/tools/pipeline/max/scene.h @@ -59,10 +59,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CScene */ @@ -81,10 +82,11 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CSceneClassContainer */ @@ -105,6 +107,8 @@ public: // inherited virtual std::string getClassName(); virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void build(uint16 version); // static const static const ucchar *DisplayName; @@ -117,7 +121,6 @@ public: protected: virtual IStorageObject *createChunkById(uint16 id, bool container); - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; /* class CSceneClass */ diff --git a/code/nel/tools/pipeline/max/storage_object.cpp b/code/nel/tools/pipeline/max/storage_object.cpp index a36801326..c623d47dd 100644 --- a/code/nel/tools/pipeline/max/storage_object.cpp +++ b/code/nel/tools/pipeline/max/storage_object.cpp @@ -140,6 +140,28 @@ void CStorageContainer::toString(std::ostream &ostream, const std::string &pad) ostream << "} "; } +void CStorageContainer::parse(uint16 version, TParseLevel level) +{ + for (TStorageObjectContainer::const_iterator it = Chunks.begin(), end = Chunks.end(); it != end; ++it) + { + if (it->second->isContainer()) + { + static_cast(it->second)->parse(version, level); + } + } +} + +void CStorageContainer::build(uint16 version) +{ + for (TStorageObjectContainer::const_iterator it = Chunks.begin(), end = Chunks.end(); it != end; ++it) + { + if (it->second->isContainer()) + { + static_cast(it->second)->build(version); + } + } +} + bool CStorageContainer::isContainer() const { return true; @@ -167,9 +189,9 @@ void CStorageContainer::serial(CStorageChunks &chunks) Chunks.push_back(TStorageObjectWithId(id, storageObject)); if (chunks.leaveChunk()) // bytes were skipped while reading throw EStorage(); - TStorageObjectContainer::iterator soit = Chunks.end(); + /*TStorageObjectContainer::iterator soit = Chunks.end(); --soit; - serialized(soit, cont); + serialized(soit, cont);*/ } } else @@ -195,11 +217,6 @@ IStorageObject *CStorageContainer::createChunkById(uint16 id, bool container) } } -void CStorageContainer::serialized(TStorageObjectContainer::iterator soit, bool container) -{ - -} - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max/storage_object.h b/code/nel/tools/pipeline/max/storage_object.h index b2f0b8bbc..44adad187 100644 --- a/code/nel/tools/pipeline/max/storage_object.h +++ b/code/nel/tools/pipeline/max/storage_object.h @@ -49,12 +49,23 @@ struct EStorage : public NLMISC::Exception enum TParseLevel { - PARSE_SYSTEM = 0x00000001, // Parse system related classes + PARSE_INTERNAL = 0x00000001, // Directly parse basic class formats // PARSE_BUILTIN = 0x00000002; // Parse all builtin classes - reserved - PARSE_NELDATA = 0x00000004, // Parse all structures related to nel specific data (nel material, node properties, etcetera) - PARSE_NEL3D = 0x00000008, // Parse classes to initialize their nel3d equivalent classes + // PARSE_NELDATA = 0x00000004, // Parse all structures related to nel specific data (nel material, node properties, etcetera) + // PARSE_NEL3D = 0x00000008, // Parse classes to initialize their nel3d equivalent classes }; +// NOTE: This is the wrong location. Make a definitions header. +const uint16 VersionUnknown = 0x0000; +const uint16 Version3 = 0x2004; +const uint16 Version4 = 0x2006; +const uint16 Version5 = 0x2008; +const uint16 Version6 = 0x2009; +const uint16 Version9 = 0x200E; +const uint16 Version2008 = 0x200F; +const uint16 Version2010 = 0x2012; +// END OF NOTE + // IStorageObject : exposes serial(CStorageStream &stream) and dump(const std::string &pad) class IStorageObject : public NLMISC::IStreamable { @@ -87,6 +98,12 @@ public: virtual void serial(NLMISC::IStream &stream); // only used to wrap a container inside another stream virtual void toString(std::ostream &ostream, const std::string &pad = ""); + // virtual + // Parse this class with given version and parse level filter + virtual void parse(uint16 version, TParseLevel level); + // Build the storage structure needed to store the parsed data back + virtual void build(uint16 version); + public: // should be protected but that doesn't compile, nice c++! // inherited virtual bool isContainer() const; @@ -96,8 +113,6 @@ protected: virtual void serial(CStorageChunks &chunks); // Create a storage object by id, override to provide custom serialization virtual IStorageObject *createChunkById(uint16 id, bool container); - // Callback when a storage object has been serialized and put in the chunks list, override to index them - virtual void serialized(TStorageObjectContainer::iterator soit, bool container); }; // CStorageRaw : serializes raw data, use for unknown data