added method to manually denote the offset of the first child
This commit is contained in:
parent
7da37e888d
commit
3332423fca
|
@ -189,6 +189,7 @@ public:
|
||||||
void copyHeader(std::ostream &targetStream);
|
void copyHeader(std::ostream &targetStream);
|
||||||
void copyWithoutChilds(std::ostream &targetStream);
|
void copyWithoutChilds(std::ostream &targetStream);
|
||||||
void copyEntirely(std::ostream &targetStream);
|
void copyEntirely(std::ostream &targetStream);
|
||||||
|
implementationType *denoteFirstChild(uint32 offset);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
identifierType m_id;
|
identifierType m_id;
|
||||||
|
@ -825,6 +826,21 @@ void GenericFileElement<ImplementationType>::copyInternal(std::ostream &targetSt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Denotes the first child to start at the specified \a offset (relative to the start offset of this descriptor).
|
||||||
|
* \remarks A new first child is constructed. A possibly existing subtree is invalidated.
|
||||||
|
*/
|
||||||
|
template <class ImplementationType>
|
||||||
|
typename GenericFileElement<ImplementationType>::implementationType *GenericFileElement<ImplementationType>::denoteFirstChild(uint32 relativeFirstChildOffset)
|
||||||
|
{
|
||||||
|
if(relativeFirstChildOffset + 4 < dataSize()) {
|
||||||
|
m_firstChild.reset(new implementationType(static_cast<implementationType &>(*this), startOffset() + relativeFirstChildOffset));
|
||||||
|
} else {
|
||||||
|
m_firstChild.reset();
|
||||||
|
}
|
||||||
|
return m_firstChild.get();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the maximum id length supported by the class in byte.
|
* \brief Returns the maximum id length supported by the class in byte.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue