1 // SSObject.h: interface for the SSObject class.
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_SSOBJECT_H__C8DBBC42_EE5F_4F9B_8935_5831008AB2BF__INCLUDED_)
6 #define AFX_SSOBJECT_H__C8DBBC42_EE5F_4F9B_8935_5831008AB2BF__INCLUDED_
10 #endif // _MSC_VER > 1000
17 class SSVersionObject
;
18 class SSCheckOutObject
;
20 class SSCommentObject
;
21 class SSProjectObject
;
22 class SSParentFolderObject
;
23 class SSBranchFileObject
;
24 //class SSItemInfoObject;
31 virtual ~ISSContext () {};
34 class ISSObjectVisitor
37 virtual void Apply(const SSObject
& object
, const ISSContext
* pCtx
) = 0;
39 virtual void Apply(const SSVersionObject
& object
, const ISSContext
* pCtx
) = 0;
40 virtual void Apply(const SSCheckOutObject
& object
, const ISSContext
* pCtx
) = 0;
41 virtual void Apply(const SSNameObject
& object
, const ISSContext
* pCtx
) = 0;
42 virtual void Apply(const SSCommentObject
& object
, const ISSContext
* pCtx
) = 0;
43 virtual void Apply(const SSProjectObject
& object
, const ISSContext
* pCtx
) = 0;
44 virtual void Apply(const SSParentFolderObject
& object
, const ISSContext
* pCtx
) = 0;
45 virtual void Apply(const SSBranchFileObject
& object
, const ISSContext
* pCtx
) = 0;
47 // virtual void Apply(const SSItemInfoObject& object, const ISSContext* pCtx) = 0;
48 virtual void Apply(const SSFileItem
& object
, const ISSContext
* pCtx
) = 0;
49 virtual void Apply(const SSProjectItem
& object
, const ISSContext
* pCtx
) = 0;
57 SSObject (SSRecordPtr pRecord
, eType type
);
63 static SSObject
* MakeObject (SSRecordPtr pRecord
);
65 virtual void Accept (ISSObjectVisitor
& rVisitor
, const ISSContext
* pCtx
= NULL
) const { rVisitor
.Apply (*this, pCtx
); };
66 virtual bool Validate () { return true; }
68 SSFileImpPtr
GetFile () const { return m_pRecord
->GetFileImp (); }
69 eType
GetType () const { return m_pRecord
->GetType (); }
70 long GetOffset () const { return m_pRecord
->GetOffset(); }
72 const byte
* GetData () const { return m_pRecord
->GetBuffer (); }
74 SSRecordPtr
GetRecord () const { return m_pRecord
; }
76 operator bool () const { return m_pRecord
; }
78 virtual std::string
GetName () const;
79 virtual void ToXml (XMLNode
* pParent
) const;
80 virtual void Dump (std::ostream
& os
) const;
83 // const byte* GetDataPtr () const;
84 // byte* GetDataPtr ();
88 SSRecordPtr m_pRecord
;
92 #endif // !defined(AFX_SSOBJECT_H__C8DBBC42_EE5F_4F9B_8935_5831008AB2BF__INCLUDED_)