Expand environment-handling in folly
authorPhil Willoughby <philwill@fb.com>
Fri, 24 Mar 2017 09:05:42 +0000 (02:05 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 24 Mar 2017 09:06:46 +0000 (02:06 -0700)
commit55cd50f37f6d8b137093fc976b780465442174fa
treef8b892eee712858f13b9bc7f37bc29fba25810f1
parentd91466dc5a098c3cae4bc137e79230c10f123496
Expand environment-handling in folly

Summary:
Extract the environment-as-STL-map logic out of `test::EnvVarSaver` and into a
separate class `experimental::EnvironmentState` so that other code which needs
to manipulate the environment can do so more easily.

Add routines to set the process environment from the state of an
`EnvironmentState`'s map, and to extract the environment in the forms required
by `Subprocess` and the UNIX routines `execve` etc.

Reviewed By: yfeldblum

Differential Revision: D4713307

fbshipit-source-id: 6b1380dd29b9ba41c97b886814dd3eee91fc1c0f
folly/experimental/EnvUtil.cpp
folly/experimental/EnvUtil.h
folly/experimental/test/EnvUtilSubprocess.cpp [new file with mode: 0644]
folly/experimental/test/EnvUtilTest.cpp