From d4146475d9b1cfa19a889252779b4ce48b63ae86 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Mon, 15 Oct 2018 23:22:55 +0200 Subject: [PATCH] Added new function null_device(), which returns the name of the NULL device (e.g. "/dev/null" or "NUL") for the current platform. --- include/MUtils/OSSupport.h | 3 +++ src/OSSupport_Win32.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/MUtils/OSSupport.h b/include/MUtils/OSSupport.h index dc7f16d..098b2b7 100644 --- a/include/MUtils/OSSupport.h +++ b/include/MUtils/OSSupport.h @@ -264,6 +264,9 @@ namespace MUtils MUTILS_API QString get_envvar(const QString &name); MUTILS_API bool set_envvar(const QString &name, const QString &value); + //NULL device + MUTILS_API const QLatin1String &null_device(void); + //Check if debugger is present MUTILS_API void check_debugger(void); diff --git a/src/OSSupport_Win32.cpp b/src/OSSupport_Win32.cpp index bef14ba..8d88d29 100644 --- a/src/OSSupport_Win32.cpp +++ b/src/OSSupport_Win32.cpp @@ -1789,6 +1789,17 @@ bool MUtils::OS::set_envvar(const QString &name, const QString &value) return false; } +/////////////////////////////////////////////////////////////////////////////// +// NULL DEVICE +/////////////////////////////////////////////////////////////////////////////// + +static const QLatin1String NULL_DEVICE("NUL"); + +const QLatin1String &MUtils::OS::null_device(void) +{ + return NULL_DEVICE; +} + /////////////////////////////////////////////////////////////////////////////// // DEBUGGER CHECK ///////////////////////////////////////////////////////////////////////////////