From 1978c49bea5b439d993067c055cec47e70db8fd6 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sat, 7 Oct 2023 22:33:50 +0200 Subject: minor refactoring --- src/tools.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/tools.cc') diff --git a/src/tools.cc b/src/tools.cc index 95c28d6..1b6e28a 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,42 +1,39 @@ -/** -------------------------------------------------------------------- +/** * @file tools.cc * @brief Implementation of miscellaneous tools. * @author Andreas Aardal Hanssen * @date 2002-2005 - * ------------------------------------------------------------------ **/ + */ + #include "tools.h" #include #include -using namespace ::std; using namespace Binc; +using std::string; -//------------------------------------------------------------------------ Tools::Tools(void) {} -//------------------------------------------------------------------------ Tools &Tools::getInstance(void) { static Tools tools; return tools; } -//------------------------------------------------------------------------ void Tools::setenv(const string &key, const string &value) const { char *c = strdup((key + "=" + value).c_str()); putenv(c); } -//------------------------------------------------------------------------ string Tools::getenv(const string &key) const { static const string NIL = ""; const char *c = ::getenv((char *)key.c_str()); - if (c == 0) + if (c == nullptr) return NIL; else return string(c); -- cgit v1.2.3