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.

41 lines
1.4 KiB

  1. #if !defined(_FUSION_SXS_PARTIALVERSION_H_INCLUDED_)
  2. #define _FUSION_SXS_PARTIALVERSION_H_INCLUDED_
  3. #pragma once
  4. #include <sxsapi.h>
  5. #include "fusionbuffer.h"
  6. //
  7. // A CPartialAssemblyVersion is a class that wraps an inexact version
  8. // specification.
  9. //
  10. // The initial implementation just assumes that it's basically an ASSEMBLY_VERSION,
  11. // but that any of the fields may be "wildcarded".
  12. //
  13. // Future versions may allow for more interesting partial version specifications
  14. // such as "major=5; minor=1; build=2103; revision >= 100". This is beyond the
  15. // bounds of the initial implementation, but forms the basis for the public
  16. // interface (parse, format, test match)
  17. //
  18. class CPartialAssemblyVersion
  19. {
  20. public:
  21. CPartialAssemblyVersion() : m_MajorSpecified(FALSE), m_MinorSpecified(FALSE), m_BuildSpecified(FALSE), m_RevisionSpecified(FALSE) { }
  22. ~CPartialAssemblyVersion() { }
  23. BOOL Parse(PCWSTR VersionString, SIZE_T VersionStringCch);
  24. BOOL Format(CBaseStringBuffer &rOutputBuffer, SIZE_T *CchOut) const;
  25. BOOL Matches(const ASSEMBLY_VERSION &rav) const;
  26. // Returns true of any ASSEMBLY_VERSION would match (e.g. "*" or "*.*.*.*")
  27. BOOL MatchesAny() const { return !(m_MajorSpecified || m_MinorSpecified || m_BuildSpecified || m_RevisionSpecified); }
  28. protected:
  29. ASSEMBLY_VERSION m_AssemblyVersion;
  30. BOOL m_MajorSpecified, m_MinorSpecified, m_BuildSpecified, m_RevisionSpecified;
  31. };
  32. #endif