Add Dirk Luetjen's ssphys libraries and command-line tool
[vss2svn.git] / ssphys / SSPhys / Formatter.h
blob6dac24422e69f58a2e57728a0bba9ca3bebf19e6
1 // IFormatter.h: interface for the IFormatter class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_)
6 #define AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include "Options.h"
13 #include <SSPhysLib\SSVersionObject.h>
15 enum eStyle {eBinary, eXML, eVSS, eDump};
17 class IFormattingContext : public ISSContext
19 public:
20 virtual bool GetExtendedOutput () const = 0;
23 //class CFormatter : public COptions, public ISSObjectVisitor
24 //{
25 //public:
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) {};
40 //protected:
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;
43 //};
45 class CFormatter : public COptions
47 public:
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
60 public:
61 static std::auto_ptr<CFormatter> MakeFormatter (eStyle style, tristate value);
65 #endif // !defined(AFX_IFORMATTER_H__41F6915F_65BC_4A55_B2C8_1C125237E7CB__INCLUDED_)