Sha256: 8791b61fe1402d238d054ef571fe2d7fcb7f0d772efe8f00548eff4fe4cb0d03

Contents?: true

Size: 693 Bytes

Versions: 16

Compression:

Stored size: 693 Bytes

Contents

#include <leatherman/util/environment.hpp>
#include <boost/nowide/cenv.hpp>

using namespace std;

namespace leatherman { namespace util {

    bool environment::get(string const& name, string& value)
    {
        auto variable = boost::nowide::getenv(name.c_str());
        if (!variable) {
            return false;
        }

        value = variable;
        return true;
    }

    bool environment::set(string const& name, string const& value)
    {
        return boost::nowide::setenv(name.c_str(), value.c_str(), 1) == 0;
    }

    bool environment::clear(string const& name)
    {
        return boost::nowide::unsetenv(name.c_str()) == 0;
    }

}}  // namespace leatherman::util

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/leatherman/util/src/environment.cc
facter-3.12.1.cfacter.20181031 ext/facter/leatherman/util/src/environment.cc
facter-3.11.6.cfacter.20181031 ext/facter/leatherman/util/src/environment.cc
facter-3.12.1.cfacter.20181023 ext/facter/leatherman/util/src/environment.cc
facter-3.11.5.cfacter.20181022 ext/facter/leatherman/util/src/environment.cc
facter-3.12.0.cfacter.20181004 ext/facter/leatherman/util/src/environment.cc
facter-3.12.0.cfacter.20181001 ext/facter/leatherman/util/src/environment.cc
facter-3.12.0.cfacter.20180918 ext/facter/leatherman/util/src/environment.cc
facter-3.11.4.cfacter.20180821 ext/facter/leatherman/util/src/environment.cc
facter-3.11.3.cfacter.20180716 ext/facter/leatherman/util/src/environment.cc
facter-3.11.2.cfacter.20180612 ext/facter/leatherman/util/src/environment.cc
facter-3.9.6.cfacter.20180612 ext/facter/leatherman/util/src/environment.cc
facter-3.11.2.cfacter.20180606 ext/facter/leatherman/util/src/environment.cc
facter-3.9.6.cfacter.20180606 ext/facter/leatherman/util/src/environment.cc
facter-3.11.0.cfacter.20180319 ext/facter/leatherman/util/src/environment.cc
cfacter-3.11.0.rc.20180314 ext/facter/leatherman/util/src/environment.cc