summaryrefslogtreecommitdiff
path: root/src/tools.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-07 22:33:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-08 11:35:51 +0200
commit1978c49bea5b439d993067c055cec47e70db8fd6 (patch)
tree255caea96a13f95564e6b631be9a4ac55ce33cd9 /src/tools.cc
parent3b1278f5459514a6d6364f068ff97b8a0432057b (diff)
minor refactoring
Diffstat (limited to 'src/tools.cc')
-rw-r--r--src/tools.cc13
1 files changed, 5 insertions, 8 deletions
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 <cstring>
#include <errno.h>
-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);