Class windows_version_info

Synopsis

#include "breeze/environment/windows_only/windows_version_info.hpp"

class windows_version_info

Description

Microsoft Windows version information.

Methods

windows_version_info overloadConstructs a windows_version_info object.
windows_version_info overloadDeleted copy constructor.
~windows_version_infoDestroys a windows_version_info object.
build_numberReturns: The build number of the operating system.
editionReturns: A (possibly empty) string with the edition of the operating system
is_64_bitReturns: Whether the OS is 64-bit.
is_clientReturns: Whether the OS is a Windows client version.
major_versionReturns: The major version number of the operating system.
minor_versionReturns: The minor version number of the operating system.
operator=Deleted copy assignment operator.
service_pack_levelReturns: The service pack level

Source

Lines 26-96 in breeze/environment/windows_only/windows_version_info.hpp.

class windows_version_info
{
public:
    //!     Constructs a \c windows_version_info object.
    // -----------------------------------------------------------------------
                        windows_version_info() ;

    //!     Destroys a \c windows_version_info object.
    // -----------------------------------------------------------------------
                        ~windows_version_info() noexcept ;

    //!     Deleted copy constructor.
    // -----------------------------------------------------------------------
                        windows_version_info( windows_version_info const & )
                                                                   = delete ;

    //!     Deleted copy assignment operator.
    // -----------------------------------------------------------------------
    windows_version_info &
                        operator =( windows_version_info const & ) = delete ;

    //!     \return
    //!         The major version number of the operating system.
    // -----------------------------------------------------------------------
    int                 major_version() const ;

    //!     \return
    //!         The minor version number of the operating system.
    // -----------------------------------------------------------------------
    int                 minor_version() const ;

    //!     \return
    //!         The build number of the operating system.
    // -----------------------------------------------------------------------
    int                 build_number() const ;

    //!     \return
    //!         A (possibly empty) string with the edition of the
    //!         operating system. The return type could be <code>maybe<
    //!         std::string ></code> but I didn't want to introduce
    //!         another dependency.
    // -----------------------------------------------------------------------
    std::string         edition() const ;

    //!     \return
    //!         Whether the OS is 64-bit.
    // -----------------------------------------------------------------------
    static bool         is_64_bit() ;

    //!     \return
    //!         Whether the OS is a Windows client version.
    // -----------------------------------------------------------------------
    static bool         is_client() ;

    //!     \return
    //!         The service pack level. Zero if no service pack is
    //!         installed.
    //!
    //!     \par Exceptions
    //!         A \c std::runtime_error (which can be a \c
    //!         last_api_error) if an error occurs.
    // -----------------------------------------------------------------------
    static int          service_pack_level() ;

private:
    static bool         is_wow64_process() ;

    int                 m_major_version ;
    int                 m_minor_version ;
    int                 m_build_number ;
} ;