28 #include <QStringList> 55 qWarning()<<
KLF_FUNC_NAME<<
": Invalid sysarch string "<<sysarch;
59 if (thisos != sysarch.
left(ic)) {
60 klfDbg(
"incompatible architectures (this one)="<<thisos<<
" and (tested)="<<sysarch) ;
65 klfDbg(
"testing if our arch="<<thisarch<<
" is in the compatible arch list="<<archlist) ;
71 #if defined(Q_OS_LINUX) 73 #elif defined(Q_OS_DARWIN) 75 #elif defined(Q_OS_WIN32) 91 qWarning(
"KLFSysInfo::osString: unknown OS: %d", sysos);
100 #elif defined(Q_OS_LINUX) 104 #elif defined(Q_OS_WIN32) 112 #if defined(Q_OS_DARWIN) 114 #elif defined(Q_OS_LINUX) 116 #elif defined(Q_OS_WIN32) 123 static int _klf_cached_islaptop = -1;
127 if (_klf_cached_islaptop >= 0)
128 return (
bool) _klf_cached_islaptop;
130 #if defined(Q_OS_DARWIN) 132 #elif defined(Q_OS_LINUX) 134 #elif defined(Q_OS_WIN32) 137 return (
bool) _klf_cached_islaptop;
142 #if defined(Q_OS_DARWIN) 144 #elif defined(Q_OS_LINUX) 146 #elif defined(Q_OS_WIN32) KLF_EXPORT bool _klf_mac_is_on_battery_power()
systems on which neither Q_OS_{LINUX|WIN32|DARWIN} is defined
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
KLF_EXPORT QString makeSysArch(const QString &os, const QString &arch)
Os
List of known operating systems.
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_win_battery_info()
KLF_EXPORT bool _klf_linux_is_laptop()
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
#define KLF_DEBUG_TEE(expr)
Print the value of expression and return it.
Base declarations for klatexformula and some utilities.
KLF_EXPORT bool _klf_linux_is_on_battery_power()
bool contains(const QString &str, Qt::CaseSensitivity cs) const
#define klfDbg(streamableItems)
print debug stream items
KLF_EXPORT bool _klf_win_is_laptop()
systems on which Q_OS_DARWIN is defined
KLF_EXPORT QString arch()
The architecture of this sytem.
KLF_EXPORT bool isLaptop()
KLF_EXPORT BatteryInfo batteryInfo()
KLF_EXPORT bool isOnBatteryPower()
QString & replace(int position, int n, QChar after)
QString mid(int position, int n) const
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_linux_battery_info(bool want_info_onbatterypower)
QString klf_defs_sysinfo_arch()
KLF_EXPORT KLFSysInfo::Os os()
Which operating system this system is running.
QString left(int n) const
KLF_EXPORT bool isCompatibleSysArch(const QString &sysarch)
KLF_EXPORT bool _klf_win_is_on_battery_power()
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_mac_battery_info()
systems on which Q_OS_WIN32 is defined
systems on which Q_OS_LINUX is defined
KLF_EXPORT QString osString(KLFSysInfo::Os sysos=os())
The operating system we are running, returned as a string.
KLF_EXPORT bool _klf_mac_is_laptop()