From a8a0d07295afaebdad0f3038745c8e36ef40fdde Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sat, 18 Aug 2007 16:12:51 +0000 Subject: [PATCH] Added VLDebugFlags --- Sources/VLDebugFlags.cpp | 22 ++++++++++++++++++++++ Sources/VLDebugFlags.h | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Sources/VLDebugFlags.cpp create mode 100644 Sources/VLDebugFlags.h diff --git a/Sources/VLDebugFlags.cpp b/Sources/VLDebugFlags.cpp new file mode 100644 index 0000000..78bb618 --- /dev/null +++ b/Sources/VLDebugFlags.cpp @@ -0,0 +1,22 @@ +// +// File: VLDebugFlags.cpp - Runtime debugging flags +// +// Author(s): +// +// (MN) Matthias Neeracher +// +// Copyright © 2007 Matthias Neeracher +// + +#include "VLDebugFlags.h" +#include + +uint32_t VLDebugFlags::sFlags = 0; + +void VLDebugFlags::Update() +{ + const char * dbg = getenv("VOCALEASEL_DEBUG"); + + if (dbg) + sFlags = atoi(dbg); +} diff --git a/Sources/VLDebugFlags.h b/Sources/VLDebugFlags.h new file mode 100644 index 0000000..846c688 --- /dev/null +++ b/Sources/VLDebugFlags.h @@ -0,0 +1,24 @@ +// +// File: VLDebugFlags.h - Runtime debugging flags +// +// Author(s): +// +// (MN) Matthias Neeracher +// +// Copyright © 2007 Matthias Neeracher +// + +#include + +class VLDebugFlags { +public: + static void Update(); + static bool ShowDebugMenu() { return sFlags & 1; } +private: + static uint32_t sFlags; +}; + +// Local Variables: +// mode:C++ +// End: +