<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::Environment</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1> <h1 class="symbol">class Environment</h1> </div> <div class="body"> <p> <b>Library:</b> Foundation<br /> <b>Package:</b> Core<br /> <b>Header:</b> Poco/Environment.h</p> <h2>Description</h2> <div class="description"> <p>This class provides access to environment variables and some general system information. </p> </div> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.Environment.html#5605" title="Poco::Environment::get()">get</a>, <a href="Poco.Environment.html#5610" title="Poco::Environment::has()">has</a>, <a href="Poco.Environment.html#5619" title="Poco::Environment::nodeId()">nodeId</a>, <a href="Poco.Environment.html#5618" title="Poco::Environment::nodeName()">nodeName</a>, <a href="Poco.Environment.html#5617" title="Poco::Environment::osArchitecture()">osArchitecture</a>, <a href="Poco.Environment.html#5615" title="Poco::Environment::osName()">osName</a>, <a href="Poco.Environment.html#5616" title="Poco::Environment::osVersion()">osVersion</a>, <a href="Poco.Environment.html#5622" title="Poco::Environment::processorCount()">processorCount</a>, <a href="Poco.Environment.html#5612" title="Poco::Environment::set()">set</a></p> <h2>Types</h2> <h3><a name="5604">NodeId</a></h3> <p class="decl">typedef <a href="Poco.html#11350" title="Poco::UInt8">UInt8</a> <a href="Poco.Environment.html#5604" title="Poco::Environment::NodeId">NodeId</a>[6];</p> <div class="description"> <p>Ethernet address. </p> </div> <h2>Member Functions</h2> <h3><a name="5605">get</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string get(<br /> const std::string & name<br />);</p> <div class="description"> <p>Returns the value of the environment variable with the given name. Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the variable does not exist. </p> </div> <h3><a name="5607">get</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string get(<br /> const std::string & name,<br /> const std::string & defaultValue<br />);</p> <div class="description"> <p>Returns the value of the environment variable with the given name. If the environment variable is undefined, returns defaultValue instead. </p> </div> <h3><a name="5610">has</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static bool has(<br /> const std::string & name<br />);</p> <div class="description"> <p>Returns true if and only if an environment variable with the given name is defined. </p> </div> <h3><a name="5619">nodeId</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static void nodeId(<br /> <a href="Poco.Environment.html#5604" title="Poco::Environment::NodeId">NodeId</a> & id<br />);</p> <div class="description"> <p>Returns the Ethernet address of the first Ethernet adapter found on the system. </p> <p>Throws a <a href="Poco.SystemException.html" title="class Poco::SystemException">SystemException</a> if no Ethernet adapter is available. </p> </div> <h3><a name="5621">nodeId</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string nodeId();</p> <div class="description"> <p>Returns the Ethernet address (format "xx:xx:xx:xx:xx:xx") of the first Ethernet adapter found on the system. </p> <p>Throws a <a href="Poco.SystemException.html" title="class Poco::SystemException">SystemException</a> if no Ethernet adapter is available. </p> </div> <h3><a name="5618">nodeName</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string nodeName();</p> <div class="description"> <p>Returns the node (or host) name. </p> </div> <h3><a name="5617">osArchitecture</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string osArchitecture();</p> <div class="description"> <p>Returns the operating system architecture. </p> </div> <h3><a name="5615">osName</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string osName();</p> <div class="description"> <p>Returns the operating system name. </p> </div> <h3><a name="5616">osVersion</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static std::string osVersion();</p> <div class="description"> <p>Returns the operating system version. </p> </div> <h3><a name="5622">processorCount</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static unsigned processorCount();</p> <div class="description"> <p>Returns the number of processors installed in the system. </p> <p>If the number of processors cannot be determined, returns 1. </p> </div> <h3><a name="5612">set</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static void set(<br /> const std::string & name,<br /> const std::string & value<br />);</p> <div class="description"> <p>Sets the environment variable with the given name to the given value. </p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>