Struct UtsName

Synopsis

#include <src/uvw/util.h>

struct UtsName

Description

Utility class.

This class can be used to get name and information about the current kernel. The populated data includes the operating system name, release, version, and machine.

See
Utilities::uname

Methods

UtsName
machineGets the hardware identifier.
releaseGets the operating system release (like "2.6.28").
sysnameGets the operating system name (like "Linux").
versionGets the operating system version.

Source

Lines 270-299 in src/uvw/util.h.

struct UtsName {
    UtsName(std::shared_ptr<uv_utsname_t> utsname);

    /**
     * @brief Gets the operating system name (like "Linux").
     * @return The operating system name.
     */
    std::string sysname() const noexcept;

    /**
     * @brief Gets the operating system release (like "2.6.28").
     * @return The operating system release.
     */
    std::string release() const noexcept;

    /**
     * @brief Gets the operating system version.
     * @return The operating system version
     */
    std::string version() const noexcept;

    /**
     * @brief Gets the hardware identifier.
     * @return The hardware identifier.
     */
    std::string machine() const noexcept;

private:
    std::shared_ptr<uv_utsname_t> utsname;
};





Add Discussion as Guest

Log in