Added: #1440 Parser for ClassDirectory3
--HG-- branch : build_pipeline_v3hg/feature/build_pipeline_v3
parent
8410019c50
commit
7266711002
@ -0,0 +1,172 @@
|
|||||||
|
/**
|
||||||
|
* \file class_directory_3.cpp
|
||||||
|
* \brief CClassDirectory3
|
||||||
|
* \date 2012-08-18 18:01GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CClassDirectory3
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2012 by authors
|
||||||
|
*
|
||||||
|
* This file is part of RYZOM CORE PIPELINE.
|
||||||
|
* RYZOM CORE PIPELINE is free software: you can redistribute it
|
||||||
|
* and/or modify it under the terms of the GNU Affero General Public
|
||||||
|
* License as published by the Free Software Foundation, either
|
||||||
|
* version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* RYZOM CORE PIPELINE is distributed in the hope that it will be
|
||||||
|
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||||
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public
|
||||||
|
* License along with RYZOM CORE PIPELINE. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
#include "class_directory_3.h"
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
// #include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
// using namespace NLMISC;
|
||||||
|
|
||||||
|
namespace PIPELINE {
|
||||||
|
namespace MAX {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CClassDirectory3::CClassDirectory3()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CClassDirectory3::~CClassDirectory3()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CClassDirectory3::getClassName()
|
||||||
|
{
|
||||||
|
return "ClassDirectory3";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad)
|
||||||
|
{
|
||||||
|
CStorageContainer::toString(ostream, pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
IStorageObject *CClassDirectory3::createChunkById(uint16 id, bool container)
|
||||||
|
{
|
||||||
|
if (container)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0x2040: // ClassEntry
|
||||||
|
return new CClassEntry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return CStorageContainer::createChunkById(id, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassDirectory3::serialized(TStorageObjectContainer::iterator soit, bool container)
|
||||||
|
{
|
||||||
|
CStorageContainer::serialized(soit, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CClassEntry::CClassEntry()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CClassEntry::~CClassEntry()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CClassEntry::getClassName()
|
||||||
|
{
|
||||||
|
return "ClassEntry";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassEntry::toString(std::ostream &ostream, const std::string &pad)
|
||||||
|
{
|
||||||
|
CStorageContainer::toString(ostream, pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
IStorageObject *CClassEntry::createChunkById(uint16 id, bool container)
|
||||||
|
{
|
||||||
|
if (!container)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0x2060: // ClassDirectoryHeader
|
||||||
|
return new CClassDirectoryHeader();
|
||||||
|
case 0x2042: // ClassName
|
||||||
|
return new CStorageValue<ucstring>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return CStorageContainer::createChunkById(id, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassEntry::serialized(TStorageObjectContainer::iterator soit, bool container)
|
||||||
|
{
|
||||||
|
CStorageContainer::serialized(soit, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CClassDirectoryHeader::CClassDirectoryHeader()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CClassDirectoryHeader::~CClassDirectoryHeader()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CClassDirectoryHeader::getClassName()
|
||||||
|
{
|
||||||
|
return "ClassDirectoryHeader";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassDirectoryHeader::serial(NLMISC::IStream &stream)
|
||||||
|
{
|
||||||
|
stream.serial(DllIndex);
|
||||||
|
stream.serial(ClassID);
|
||||||
|
stream.serial(SuperClassID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClassDirectoryHeader::toString(std::ostream &ostream, const std::string &pad)
|
||||||
|
{
|
||||||
|
ostream << "(" << getClassName() << ") { ";
|
||||||
|
ostream << "\n" << pad << "DllIndex: " << DllIndex;
|
||||||
|
ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID);
|
||||||
|
ostream << "\n" << pad << "SuperClassID: " << SuperClassID;
|
||||||
|
ostream << "} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
} /* namespace MAX */
|
||||||
|
} /* namespace PIPELINE */
|
||||||
|
|
||||||
|
/* end of file */
|
@ -0,0 +1,117 @@
|
|||||||
|
/**
|
||||||
|
* \file class_directory_3.h
|
||||||
|
* \brief CClassDirectory3
|
||||||
|
* \date 2012-08-18 18:01GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CClassDirectory3
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2012 by authors
|
||||||
|
*
|
||||||
|
* This file is part of RYZOM CORE PIPELINE.
|
||||||
|
* RYZOM CORE PIPELINE is free software: you can redistribute it
|
||||||
|
* and/or modify it under the terms of the GNU Affero General Public
|
||||||
|
* License as published by the Free Software Foundation, either
|
||||||
|
* version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* RYZOM CORE PIPELINE is distributed in the hope that it will be
|
||||||
|
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||||
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public
|
||||||
|
* License along with RYZOM CORE PIPELINE. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PIPELINE_CLASS_DIRECTORY_3_H
|
||||||
|
#define PIPELINE_CLASS_DIRECTORY_3_H
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/class_id.h>
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "storage_object.h"
|
||||||
|
#include "storage_value.h"
|
||||||
|
|
||||||
|
namespace PIPELINE {
|
||||||
|
namespace MAX {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief CClassDirectory3
|
||||||
|
* \date 2012-08-18 18:01GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CClassDirectory3
|
||||||
|
*/
|
||||||
|
class CClassDirectory3 : public CStorageContainer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClassDirectory3();
|
||||||
|
virtual ~CClassDirectory3();
|
||||||
|
|
||||||
|
// inherited
|
||||||
|
virtual std::string getClassName();
|
||||||
|
virtual void toString(std::ostream &ostream, const std::string &pad = "");
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual IStorageObject *createChunkById(uint16 id, bool container);
|
||||||
|
virtual void serialized(TStorageObjectContainer::iterator soit, bool container);
|
||||||
|
|
||||||
|
}; /* class CClassDirectory3 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief CClassEntry
|
||||||
|
* \date 2012-08-18 18:01GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CClassEntry
|
||||||
|
*/
|
||||||
|
class CClassEntry : public CStorageContainer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClassEntry();
|
||||||
|
virtual ~CClassEntry();
|
||||||
|
|
||||||
|
// inherited
|
||||||
|
virtual std::string getClassName();
|
||||||
|
virtual void toString(std::ostream &ostream, const std::string &pad = "");
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual IStorageObject *createChunkById(uint16 id, bool container);
|
||||||
|
virtual void serialized(TStorageObjectContainer::iterator soit, bool container);
|
||||||
|
|
||||||
|
}; /* class CClassEntry */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief CClassDirectoryHeader
|
||||||
|
* \date 2012-08-18 18:01GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CClassDirectoryHeader
|
||||||
|
*/
|
||||||
|
class CClassDirectoryHeader : public IStorageObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClassDirectoryHeader();
|
||||||
|
virtual ~CClassDirectoryHeader();
|
||||||
|
|
||||||
|
// public data
|
||||||
|
sint32 DllIndex;
|
||||||
|
NLMISC::CClassId ClassID;
|
||||||
|
uint32 SuperClassID;
|
||||||
|
|
||||||
|
// inherited
|
||||||
|
virtual std::string getClassName();
|
||||||
|
virtual void serial(NLMISC::IStream &stream);
|
||||||
|
virtual void toString(std::ostream &ostream, const std::string &pad = "");
|
||||||
|
|
||||||
|
}; /* class CClassDirectoryHeader */
|
||||||
|
|
||||||
|
} /* namespace MAX */
|
||||||
|
} /* namespace PIPELINE */
|
||||||
|
|
||||||
|
#endif /* #ifndef PIPELINE_CLASS_DIRECTORY_3_H */
|
||||||
|
|
||||||
|
/* end of file */
|
Loading…
Reference in New Issue