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
);
61 SSObject (SSRecordPtr pRecord
);
64 static SSObject
* MakeObject (SSRecordPtr pRecord
);
66 virtual void Accept (ISSObjectVisitor
& rVisitor
, const ISSContext
* pCtx
= NULL
) const { rVisitor
.Apply (*this, pCtx
); };
67 virtual bool Validate () { return true; }
69 SSFileImpPtr
GetFile () const { return m_pRecord
->GetFileImp (); }
70 eType
GetType () const { return m_pRecord
->GetType (); }
71 long GetOffset () const { return m_pRecord
->GetOffset(); }
73 const byte
* GetData () const { return m_pRecord
->GetBuffer (); }
75 SSRecordPtr
GetRecord () const { return m_pRecord
; }
77 operator bool () const { return m_pRecord
; }
79 std::string
GetTypeName () const;
80 virtual void ToXml (XMLNode
* pParent
) const;
81 virtual void Dump (std::ostream
& os
) const;
84 // const byte* GetDataPtr () const;
85 // byte* GetDataPtr ();
89 SSRecordPtr m_pRecord
;
93 #endif // !defined(AFX_SSOBJECT_H__C8DBBC42_EE5F_4F9B_8935_5831008AB2BF__INCLUDED_)