| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // Copyright (C) 2016 Intel Corporation. |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 | |
| 5 | #ifndef QSYSINFO_H |
| 6 | #define QSYSINFO_H |
| 7 | |
| 8 | #include <QtCore/qtconfigmacros.h> |
| 9 | #include <QtCore/qprocessordetection.h> |
| 10 | #include <QtCore/qtcoreexports.h> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | /* |
| 15 | System information |
| 16 | */ |
| 17 | |
| 18 | class QString; |
| 19 | class QByteArray; |
| 20 | |
| 21 | class Q_CORE_EXPORT QSysInfo |
| 22 | { |
| 23 | public: |
| 24 | enum Sizes { |
| 25 | WordSize = (sizeof(void *)<<3) |
| 26 | }; |
| 27 | |
| 28 | enum Endian { |
| 29 | BigEndian, |
| 30 | LittleEndian |
| 31 | # ifdef Q_QDOC |
| 32 | , ByteOrder = BigEndian or LittleEndian |
| 33 | # elif Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 34 | , ByteOrder = BigEndian |
| 35 | # elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN |
| 36 | , ByteOrder = LittleEndian |
| 37 | # else |
| 38 | # error "Undefined byte order" |
| 39 | # endif |
| 40 | }; |
| 41 | |
| 42 | static QString buildCpuArchitecture(); |
| 43 | static QString currentCpuArchitecture(); |
| 44 | static QString buildAbi(); |
| 45 | |
| 46 | static QString kernelType(); |
| 47 | static QString kernelVersion(); |
| 48 | static QString productType(); |
| 49 | static QString productVersion(); |
| 50 | static QString prettyProductName(); |
| 51 | |
| 52 | static QString machineHostName(); |
| 53 | static QByteArray machineUniqueId(); |
| 54 | static QByteArray bootUniqueId(); |
| 55 | }; |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | #endif // QSYSINFO_H |
| 59 | |