1 // PropertiesCommand.cpp: implementation of the CPropertiesCommand class.
3 //////////////////////////////////////////////////////////////////////
6 #include "PropertiesCommand.h"
8 #include <SSPhysLib/SSFiles.h>
9 #include <SSPhysLib/SSItemInfoObject.h>
10 #include <SSPhysLib/SSProjectObject.h>
12 //////////////////////////////////////////////////////////////////////
13 // Construction/Destruction
14 //////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
17 CPropertiesCommand::CPropertiesCommand ()
18 : CMultiArgCommand ("properties", "Shows basic properties about a VSS physical file")
22 void CPropertiesCommand::Execute (po::variables_map
const& options
, std::string
const& arg
)
24 std::auto_ptr
<SSRecordFile
> file (SSRecordFile::MakeFile(arg
));
27 SSHistoryFile
* pHistory
= dynamic_cast<SSHistoryFile
*> (file
.get());
28 SSProjectFile
* pProject
= dynamic_cast<SSProjectFile
*> (file
.get());
32 std::auto_ptr
<SSItemInfoObject
> info (pHistory
->GetItemInfo ());
34 GetFormatter()->Format (*info
, this);
38 SSRecordPtr
record (pProject
->GetFirstRecord());
41 SSProjectObject
project (record
);
42 GetFormatter()->Format (project
, this);
43 record
= pProject
->GetNextRecord(record
);
48 throw SSException ("xxx is not a history file, nor a project file");