4 * \date 2012-08-18 19:24GMT
5 * \author Jan Boon (Kaetemi)
10 * Copyright (C) 2012 by authors
12 * This file is part of RYZOM CORE PIPELINE.
13 * RYZOM CORE PIPELINE is free software: you can redistribute it
14 * and/or modify it under the terms of the GNU Affero General Public
15 * License as published by the Free Software Foundation, either
16 * version 3 of the License, or (at your option) any later version.
18 * RYZOM CORE PIPELINE is distributed in the hope that it will be
19 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Affero General Public License for more details.
23 * You should have received a copy of the GNU Affero General Public
24 * License along with RYZOM CORE PIPELINE. If not, see
25 * <http://www.gnu.org/licenses/>.
28 #include <nel/misc/types_nl.h>
29 #include "class_data.h"
34 // #include <nel/misc/debug.h>
39 // using namespace NLMISC;
44 ////////////////////////////////////////////////////////////////////////
45 ////////////////////////////////////////////////////////////////////////
46 ////////////////////////////////////////////////////////////////////////
48 CClassData::CClassData()
53 CClassData::~CClassData()
58 std::string
CClassData::className() const
63 void CClassData::toString(std::ostream
&ostream
, const std::string
&pad
) const
65 CStorageContainer::toString(ostream
, pad
);
68 void CClassData::parse(uint16 version
, uint filter
)
70 CStorageContainer::parse(version
);
73 void CClassData::clean()
75 CStorageContainer::clean();
78 void CClassData::build(uint16 version
, uint filter
)
80 CStorageContainer::build(version
);
83 void CClassData::disown()
85 CStorageContainer::disown();
88 IStorageObject
*CClassData::createChunkById(uint16 id
, bool container
)
94 case 0x2100: // ClassDataEntry
95 return new CClassDataEntry();
98 return CStorageContainer::createChunkById(id
, container
);
101 ////////////////////////////////////////////////////////////////////////
102 ////////////////////////////////////////////////////////////////////////
103 ////////////////////////////////////////////////////////////////////////
105 CClassDataEntry::CClassDataEntry()
110 CClassDataEntry::~CClassDataEntry()
115 std::string
CClassDataEntry::className() const
117 return "ClassDataEntry";
120 void CClassDataEntry::toString(std::ostream
&ostream
, const std::string
&pad
) const
122 CStorageContainer::toString(ostream
, pad
);
125 void CClassDataEntry::parse(uint16 version
, uint filter
)
127 CStorageContainer::parse(version
);
130 void CClassDataEntry::clean()
132 CStorageContainer::clean();
135 void CClassDataEntry::build(uint16 version
, uint filter
)
137 CStorageContainer::build(version
);
140 void CClassDataEntry::disown()
142 CStorageContainer::disown();
145 IStorageObject
*CClassDataEntry::createChunkById(uint16 id
, bool container
)
151 case 0x2110: // ClassDataHeader
152 return new CClassDataHeader();
157 case 0x2120: // ClassDataBody: Depends on the ClassDataHeader: TODO
158 return CStorageContainer::createChunkById(id
, container
);
160 return CStorageContainer::createChunkById(id
, container
);
163 ////////////////////////////////////////////////////////////////////////
164 ////////////////////////////////////////////////////////////////////////
165 ////////////////////////////////////////////////////////////////////////
167 CClassDataHeader::CClassDataHeader()
172 CClassDataHeader::~CClassDataHeader()
177 std::string
CClassDataHeader::className() const
179 return "ClassDataHeader";
182 void CClassDataHeader::serial(NLMISC::IStream
&stream
)
184 stream
.serial(ClassID
);
185 stream
.serial(SuperClassID
);
188 void CClassDataHeader::toString(std::ostream
&ostream
, const std::string
&pad
) const
190 ostream
<< "(" << className() << ") { ";
191 ostream
<< "\n" << pad
<< "ClassID: " << NLMISC::toString(ClassID
);
192 ostream
<< "\n" << pad
<< "SuperClassID: " << SuperClassID
;
196 ////////////////////////////////////////////////////////////////////////
197 ////////////////////////////////////////////////////////////////////////
198 ////////////////////////////////////////////////////////////////////////
200 } /* namespace MAX */
201 } /* namespace PIPELINE */