diff system/System.h @ 1475:bd1a2cacd1e7 plugin-path-config

Add provisional utf-8 getenv/putenv implementations
author Chris Cannam
date Thu, 07 Jun 2018 15:35:04 +0100
parents 91231350ee22
children c5ee0746bdef
line wrap: on
line diff
--- a/system/System.h	Wed Jun 06 15:55:34 2018 +0100
+++ b/system/System.h	Thu Jun 07 15:35:04 2018 +0100
@@ -4,7 +4,7 @@
     Sonic Visualiser
     An audio file viewer and annotation editor.
     Centre for Digital Music, Queen Mary, University of London.
-    This file copyright 2006 Chris Cannam and QMUL.
+    This file copyright 2006-2018 Chris Cannam and QMUL.
     
     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License as
@@ -13,8 +13,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _SYSTEM_H_
-#define _SYSTEM_H_
+#ifndef SV_SYSTEM_H
+#define SV_SYSTEM_H
 
 #include "base/Debug.h"
 
@@ -182,6 +182,18 @@
 #define powf pow
 #endif
 
+/** Return the value of the given environment variable by reference.
+    Return true if successfully retrieved, false if unset or on error.
+    Both the variable name and the returned value are UTF-8 encoded.
+*/
+extern bool getEnvUtf8(std::string variable, std::string &value);
+
+/** Set the value of the given environment variable.
+    Return true if successfully set, false on error.
+    Both the variable name and the value must be UTF-8 encoded.
+*/
+extern bool putEnvUtf8(std::string variable, std::string value);
+
 #endif /* ! _SYSTEM_H_ */