3 extern "C" int printf(const char *, ...);
7 virtual ~Environment();
9 // Static factory method that returns the implementation that provide the
10 // appropriate platform-specific instance.
11 static Environment
* Create();
13 // Gets an environment variable's value and stores it in |result|.
14 // Returns false if the key is unset.
15 virtual bool GetVar(const char* variable_name
, char* result
) = 0;
18 class EnvironmentImpl
: public Environment
{
20 virtual bool GetVar(const char* variable_name
, char* result
) {
25 Environment::~Environment() {}
28 Environment
* Environment::Create() {
29 return new EnvironmentImpl();
35 Environment
* env
= Environment::Create();