1 // IFormatter.h: interface for the IFormatter class.
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_)
6 #define AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_
10 #endif // _MSC_VER > 1000
13 #include <SSPhysLib\SSVersionObject.h>
15 enum eStyle
{eBinary
, eXML
, eVSS
, eDump
};
17 class IFormattingContext
: public ISSContext
20 virtual bool GetExtendedOutput () const = 0;
23 //class CFormatter : public COptions, public ISSObjectVisitor
26 // virtual void Apply(const SSVersionObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
27 // virtual void Apply(const SSCheckOutObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
28 // virtual void Apply(const SSNameObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
29 // virtual void Apply(const SSCommentObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
30 // virtual void Apply(const SSProjectObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
31 // virtual void Apply(const SSParentFolderObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
32 // virtual void Apply(const SSBranchFileObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
34 // virtual void Apply(const SSFileItem& object, const ISSContext* pCtx) { Apply ((SSItemInfoObject&) object, pCtx); }
35 // virtual void Apply(const SSProjectItem& object, const ISSContext* pCtx) { Apply ((SSItemInfoObject&) object, pCtx); }
37 // // The xml formatter needs to output the physical filename
38 // virtual void SetFileName (std::string fileName) {};
41 // virtual void Apply(const SSItemInfoObject& object, const ISSContext* pCtx) { Apply ((SSObject&) object, pCtx); }
42 // virtual void Apply(const SSObject& object, const ISSContext* pCtx) = 0;
45 class CFormatter
: public COptions
48 // The xml formatter needs to output the physical filename
49 virtual void SetFileName (std::string fileName
) {};
51 virtual void Format (const SSObject
& object
, const ISSContext
* pCtx
= NULL
) = 0;
54 //////////////////////////////////////////////////////////////////////
55 extern std::auto_ptr
<CFormatter
> g_pFormatter
;
57 //////////////////////////////////////////////////////////////////////
58 class CFormatterFactory
61 static std::auto_ptr
<CFormatter
> MakeFormatter (eStyle style
, tristate value
);
65 #endif // !defined(AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_)