summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Vattekar <geir.vattekar@nokia.com>2010-06-15 11:59:41 (GMT)
committerGeir Vattekar <geir.vattekar@nokia.com>2010-06-15 11:59:41 (GMT)
commitc5b06919a8fb5d20aae41f0edf9e2ffa99eb1a8a (patch)
tree48717a331bd3760a3a142c66277faa6f08a2053d
parent7ffb1c2e821cc4d508dcedcdb7363756f9f693ff (diff)
downloadQt-c5b06919a8fb5d20aae41f0edf9e2ffa99eb1a8a.zip
Qt-c5b06919a8fb5d20aae41f0edf9e2ffa99eb1a8a.tar.gz
Qt-c5b06919a8fb5d20aae41f0edf9e2ffa99eb1a8a.tar.bz2
Doc: Documented qputenv and qgetenv
Task-number: QTBUG-4041 Reviewed-by: Morten Engvoldsen
-rw-r--r--src/corelib/global/qglobal.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 373c0b4..b31c83b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2503,6 +2503,19 @@ void qFatal(const char *msg, ...)
// getenv is declared as deprecated in VS2005. This function
// makes use of the new secure getenv function.
+/*!
+ \relates <QtGlobal>
+
+ Returns the value of the environment variable with name \a
+ varName. To get the variable string, use QByteArray::constData().
+
+ \note qgetenv() was introduced because getenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qgetenv()
+ uses the new replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qputenv()
+*/
QByteArray qgetenv(const char *varName)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -2522,6 +2535,20 @@ QByteArray qgetenv(const char *varName)
#endif
}
+/*!
+ \relates <QtGlobal>
+
+ This function sets the \a value of the environment variable named
+ \a varName. It will create the variable if it does not exist. It
+ returns 0 if the variable could not be set.
+
+ \note qputenv() was introduced because putenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qputenv()
+ uses the replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qgetenv()
+*/
bool qputenv(const char *varName, const QByteArray& value)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400