Add Dirk Luetjen's ssphys libraries and command-line tool
[vss2svn.git] / ssphys / SSRep / VersionFilter.h
blobfab1e138c67ea476f73adb4b1e4d99c31b451f84
1 // VersionFilter.h: interface for the CVersionFilter class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_VERSIONFILTER_H__66CEFF72_78D5_4F75_A69C_FCEC324CF8FD__INCLUDED_)
6 #define AFX_VERSIONFILTER_H__66CEFF72_78D5_4F75_A69C_FCEC324CF8FD__INCLUDED_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include <SSPhysLib\SSObject.h>
13 #include <SSPhysLib\SSVersionObject.h>
15 class CVersionFilter
17 public:
18 virtual ~CVersionFilter () {}
19 virtual bool Filter (SSObject* pObject) const = 0;
22 class CVersionRangeFilter : public CVersionFilter
24 public:
25 CVersionRangeFilter (int lower, int upper)
26 : m_Lower (lower), m_Upper (upper)
30 virtual bool Filter (SSObject* pObject) const
32 SSVersionObject* pAction = dynamic_cast<SSVersionObject*> (pObject);
33 if (pAction)
35 if (pAction->GetVersionNumber() >= m_Lower && pAction->GetVersionNumber() <= m_Upper)
36 return true;
38 return false;
41 private:
42 int m_Lower, m_Upper;
45 class CVersionSingleFilter : public CVersionRangeFilter
47 public:
48 CVersionSingleFilter (int version)
49 : CVersionRangeFilter (version, version)
54 #endif // !defined(AFX_VERSIONFILTER_H__66CEFF72_78D5_4F75_A69C_FCEC324CF8FD__INCLUDED_)