Bincimap
2.0.16
Easy Imapping
Loading...
Searching...
No Matches
2.0
bincimap-2.0.16
src
tools.cc
Go to the documentation of this file.
1
7
#include <errno.h>
8
#include <cstring>
9
10
#include "
tools.h
"
11
12
using namespace
::std;
13
using namespace
Binc
;
14
15
//------------------------------------------------------------------------
16
Tools::Tools(
void
)
17
{
18
}
19
20
//------------------------------------------------------------------------
21
Tools
&
Tools::getInstance
(
void
)
22
{
23
static
Tools
tools;
24
return
tools;
25
}
26
27
//------------------------------------------------------------------------
28
void
Tools::setenv
(
const
string
&key,
const
string
&value)
const
29
{
30
char
*c = strdup((key +
"="
+ value).c_str());
31
putenv(c);
32
}
33
34
//------------------------------------------------------------------------
35
string
Tools::getenv
(
const
string
&key)
const
36
{
37
static
const
string
NIL =
""
;
38
39
const
char
*c =
::getenv
((
char
*)key.c_str());
40
if
(c == 0)
41
return
NIL;
42
else
43
return
string(c);
44
}
Binc::Tools
Definition:
tools.h:11
Binc::Tools::getenv
std::string getenv(const std::string &key) const
Definition:
tools.cc:35
Binc::Tools::setenv
void setenv(const std::string &key, const std::string &value) const
Definition:
tools.cc:28
Binc::Tools::getInstance
static Tools & getInstance(void)
Definition:
tools.cc:21
Binc
Definition:
bincimapd.cc:9
tools.h
Declaration of miscellaneous tools.
Generated on Sun Sep 1 2024 12:00:02 for Bincimap by
1.9.6