Add Dirk Luetjen's ssphys libraries and command-line tool
[vss2svn.git] / ssphys / SSPhysLib / SSParentFolderObject.cpp
blobe33260f742f968838e6a0450bc7d99fe4b5af6a6
1 // SSParentFolderObject.cpp: implementation of the SSParentFolderObject class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #include "stdafx.h"
6 #include "SSParentFolderObject.h"
7 #include "SSFiles.h"
9 //---------------------------------------------------------------------------
10 #include "LeakWatcher.h"
12 #ifdef _DEBUG
13 #define new DEBUG_NEW
14 #undef THIS_FILE
15 static char THIS_FILE[] = __FILE__;
16 #endif
18 //////////////////////////////////////////////////////////////////////
19 // Construction/Destruction
20 //////////////////////////////////////////////////////////////////////
22 SSParentFolderObject::SSParentFolderObject(SSRecordPtr pRecord)
23 : SSObject (pRecord, eParentFolder)
25 if (pRecord->GetLen() < sizeof (PF))
26 throw SSRecordException ("not enough data for parent folder (PF) object");
29 SSParentFolderObject::~SSParentFolderObject()
34 SSParentFolderObject* SSParentFolderObject::GetPrevious ()
36 SSRecordPtr pRecord = GetFile()->GetRecord(GetPreviousOffset ());
37 return new SSParentFolderObject (pRecord);
40 void SSParentFolderObject::ToXml (XMLNode* pParent) const
42 XMLElement previous (pParent, "PreviousOffset", GetPreviousOffset());
43 XMLElement parent (pParent, "ParentPhys", GetParentPhys());
46 void SSParentFolderObject::Dump (std::ostream& os) const
48 SSObject::Dump (os);
50 os << "Previous: 0x" << std::hex << GetPreviousOffset() << std::dec << std::endl;
51 os << "Parent : " << GetParentPhys() << std::endl;