1 // SSItem.h: interface for the SSItem class.
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_SSITEM_H__CB9B12A5_D0F5_4015_BB9A_18DEC6265E3A__INCLUDED_)
6 #define AFX_SSITEM_H__CB9B12A5_D0F5_4015_BB9A_18DEC6265E3A__INCLUDED_
10 #endif // _MSC_VER > 1000
12 #include <SSPhysLib\SSFiles.h>
13 #include <SSPhysLib\SSProjectObject.h>
14 #include <SSPhysLib\SSVersionObject.h>
16 #include <boost\enable_shared_from_this.hpp>
18 // forward declaration
19 // #include "SSDatabase.h"
25 typedef boost::shared_ptr
<SSItem
> SSItemPtr
;
27 class SSItem
: public boost::enable_shared_from_this
<SSItem
>
31 // SSItem(SSHistoryFile& rFile, int nVersion);
32 // SSItem(SSDatabase* pDb);
33 SSItem(SSDatabase
* pDb
, SSItemPtr pParent
, SSProjectObject project
, int version
);
34 SSItem(SSDatabase
* pDb
, SSItemPtr pParent
, SSProjectObject project
);
37 // _bstr_t GetSpec ( );
38 std::string
GetSpec ();
40 // VARIANT_BOOL GetBinary ( );
42 // VARIANT_BOOL pbBinary );
45 // VARIANT_BOOL GetDeleted ( );
47 // VARIANT_BOOL pbDeleted );
53 // _bstr_t GetLocalSpec ( );
54 // void PutLocalSpec (
56 std::string
GetLocalSpec ();
58 // _bstr_t GetName ( );
61 std::string
GetName ();
63 // IVSSItemPtr GetParent ( );
64 SSItemPtr
GetParent ();
66 // long GetVersionNumber ( );
67 long GetVersionNumber ( );
69 // IVSSItemsPtr GetItems (
70 // VARIANT_BOOL IncludeDeleted );
71 SSItems
* GetItems (bool includeDeleted
);
87 // HRESULT UndoCheckout (
91 long GetIsCheckedOut ( );
93 // IVSSCheckoutsPtr GetCheckouts ( );
95 // VARIANT_BOOL GetIsDifferent (
103 // IVSSItemPtr NewSubproject (
105 // _bstr_t Comment );
108 // struct IVSSItem * pIItem,
112 // HRESULT Destroy ( );
115 // struct IVSSItem * pINewParent );
119 // _bstr_t Comment );
121 // IVSSVersionsPtr GetVersions (
123 SSVersions
* GetVersions ( long iFlags
);
125 // IVSSItemPtr GetVersion (
126 // const _variant_t & Version = vtMissing );
127 SSItemPtr
GetVersion (std::string v
);
129 SSDatabase
* GetDatabase () { return m_pDatabase
; }
131 std::string
GetPhysical ();
135 void Rename (SSNAME oldName
, SSNAME newName
);
139 SSProjectObject m_ItemDescr
;
141 // long m_nVersionNumber;
142 SSDatabase
* m_pDatabase
;
146 class SSItems
: public ISSActionVisitor
149 SSItems (SSItemPtr pParent
, SSProjectFile
& rFile
, bool bIncludeDeleted
);
152 long GetCount () { return m_Items
.size (); }
153 SSItemPtr
GetItem (long i
);
154 SSItemPtr
GetPhysicalItem (std::string physical
);
156 // ISSActionVisitor Interface for Undo
157 virtual bool Apply (const SSLabeledAction
& rAction
);
158 virtual bool Apply (const SSCreatedProjectAction
& rAction
);
159 virtual bool Apply (const SSCreatedFileAction
& rAction
);
160 virtual bool Apply (const SSDestroyedFileAction
& rAction
);
161 virtual bool Apply (const SSDestroyedProjectAction
& rAction
);
162 virtual bool Apply (const SSAddedFileAction
& rAction
);
163 virtual bool Apply (const SSAddedProjectAction
& rAction
);
164 virtual bool Apply (const SSDeletedFileAction
& rAction
);
165 virtual bool Apply (const SSDeletedProjectAction
& rAction
);
166 virtual bool Apply (const SSRenamedProjectAction
& rAction
); //, SSNAME oldName, SSNAME newName);
167 virtual bool Apply (const SSRenamedFileAction
& rAction
); //, SSNAME oldName, SSNAME newName);
168 virtual bool Apply (const SSCheckedInAction
& rAction
);
170 // bool DeleteFile (SSAction& rAction);
171 // bool DeleteProject (SSAction& rAction);
174 void Dump (std::ostream
& os
) const;
176 void BuildList (SSItemPtr rParent
, SSProjectFile
& rFile
, bool bIncludeDeleted
);
179 std::vector
<SSItemPtr
> m_Items
;
182 #endif // !defined(AFX_SSITEM_H__CB9B12A5_D0F5_4015_BB9A_18DEC6265E3A__INCLUDED_)