Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: worddiff.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // Declaration of the CWordDiff
  8. //-----------------------------------------------------------------------------
  9. #ifndef WORDDIFF_H
  10. #define WORDDIFF_H
  11. typedef _bstr_t CWordUnit;
  12. class CWordDiff : public CDifference
  13. {
  14. public:
  15. CWordDiff(ChangeType type,
  16. int nOldPos,
  17. int nNewPos,
  18. bool bIsFirst,
  19. bool bIsLast,
  20. _bstr_t bstrWord,
  21. const wchar_t * pwszPrefix,
  22. const wchar_t * pwszSufix);
  23. virtual ChangeType GetChangeType() const; // types of change that caused the difference
  24. virtual const wchar_t * GetUnit() const; // comparison unit (0-terminated string)
  25. virtual int GetOldUnitPosition() const; // 0-based position in old sequence. -1 if Added
  26. virtual int GetNewUnitPosition() const; // 0-based position in new sequence. -1 if Deleted
  27. virtual const wchar_t * GetPrefix() const; //prpend this string to unit string
  28. virtual const wchar_t * GetSufix() const; //append this string to unit string
  29. virtual bool IsFirst() const; //is this first difference in delta?
  30. virtual bool IsLast() const; //is this last difference in delta?
  31. private:
  32. ChangeType m_ChangeType;
  33. CWordUnit m_Word;
  34. const wchar_t * m_pwszPrefix;
  35. const wchar_t * m_pwszSufix;
  36. bool m_bIsFirst;
  37. bool m_bIsLast;
  38. int m_nOldPos;
  39. int m_nNewPos;
  40. };
  41. #if !defined(_DEBUG) || defined(IMPLEMENT)
  42. #include "worddiff.inl"
  43. #endif
  44. #endif // WORDDIFF_H