[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Classes | Enumerations | Functions
KLFSysInfo Namespace Reference

Utilities to get system information. More...

Classes

struct  BatteryInfo
 

Enumerations

enum  Os { Linux, Win32, MacOsX, OtherOs }
 List of known operating systems. More...
 

Functions

int sizeofVoidStar ()
 the processor register size. More...
 
KLF_EXPORT QString arch ()
 The architecture of this sytem. More...
 
KLF_EXPORT QString makeSysArch (const QString &os, const QString &arch)
 
KLF_EXPORT bool isCompatibleSysArch (const QString &sysarch)
 
KLF_EXPORT KLFSysInfo::Os os ()
 Which operating system this system is running. More...
 
KLF_EXPORT QString osString (KLFSysInfo::Os sysos=os())
 The operating system we are running, returned as a string. More...
 
KLF_EXPORT BatteryInfo batteryInfo ()
 
KLF_EXPORT bool isLaptop ()
 
KLF_EXPORT bool isOnBatteryPower ()
 

Detailed Description

Utilities to get system information.

Enumeration Type Documentation

◆ Os

List of known operating systems.

Enumerator
Linux 

systems on which Q_OS_LINUX is defined

Win32 

systems on which Q_OS_WIN32 is defined

MacOsX 

systems on which Q_OS_DARWIN is defined

OtherOs 

systems on which neither Q_OS_{LINUX|WIN32|DARWIN} is defined

Definition at line 32 of file klfsysinfo.h.

Function Documentation

◆ arch()

KLF_EXPORT QString KLFSysInfo::arch ( )

The architecture of this sytem.

Returns
The current running system architecture.

Definition at line 37 of file klfsysinfo.cpp.

References klf_defs_sysinfo_arch().

Referenced by sizeofVoidStar().

◆ batteryInfo()

KLF_EXPORT KLFSysInfo::BatteryInfo KLFSysInfo::batteryInfo ( )

◆ isCompatibleSysArch()

KLF_EXPORT bool KLFSysInfo::isCompatibleSysArch ( const QString sysarch)

◆ isLaptop()

KLF_EXPORT bool KLFSysInfo::isLaptop ( )

Definition at line 125 of file klfsysinfo.cpp.

◆ isOnBatteryPower()

KLF_EXPORT bool KLFSysInfo::isOnBatteryPower ( )

◆ makeSysArch()

KLF_EXPORT QString KLFSysInfo::makeSysArch ( const QString os,
const QString arch 
)

Definition at line 42 of file klfsysinfo.cpp.

Referenced by sizeofVoidStar().

◆ os()

KLF_EXPORT KLFSysInfo::Os KLFSysInfo::os ( )

Which operating system this system is running.

Returns
one of the values of the Os enum.

Definition at line 69 of file klfsysinfo.cpp.

References Linux, MacOsX, OtherOs, and Win32.

Referenced by sizeofVoidStar().

◆ osString()

KLF_EXPORT QString KLFSysInfo::osString ( KLFSysInfo::Os  sysos = os())

The operating system we are running, returned as a string.

Returns
one of "win32", "linux", "macosx", or QString() for other/unknown.

Definition at line 82 of file klfsysinfo.cpp.

References _klf_linux_battery_info(), _klf_linux_is_laptop(), _klf_linux_is_on_battery_power(), _klf_mac_battery_info(), _klf_mac_is_laptop(), _klf_mac_is_on_battery_power(), _klf_win_battery_info(), _klf_win_is_laptop(), _klf_win_is_on_battery_power(), Linux, MacOsX, OtherOs, and Win32.

Referenced by isCompatibleSysArch(), and sizeofVoidStar().

◆ sizeofVoidStar()

int KLFSysInfo::sizeofVoidStar ( )
inline

the processor register size.

Typically 4 or 8 to indicate a 32-bit or a 64-bit system, respectively.

Definition at line 34 of file klfsysinfo.h.

References arch(), isCompatibleSysArch(), KLF_EXPORT, makeSysArch(), os(), and osString().


Generated by doxygen 1.8.13