summaryrefslogtreecommitdiffstats
path: root/src/Util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util.h')
-rw-r--r--src/Util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Util.h b/src/Util.h
index aaa0178..836e8f3 100644
--- a/src/Util.h
+++ b/src/Util.h
@@ -3,6 +3,8 @@
#include <uuid/uuid.h>
#include <sys/utsname.h>
+#include <stdlib.h>
+#include "String.h"
namespace PY {
@@ -40,6 +42,18 @@ public:
}
};
+class Env : public String {
+public:
+ Env (const gchar *name) {
+ gchar *str;
+ str = getenv (name);
+ assign (str != NULL ? str : "");
+ }
+ operator const gchar *(void) const {
+ return c_str();
+ }
+};
+
class StaticString {
public:
StaticString (const gchar *str) : m_string (str) {}