Changeset 198 for trunk/lib/utility.cc


Ignore:
Timestamp:
Sep 9, 2006, 12:04:27 PM (15 years ago)
Author:
Peter Johansson
Message:

refs #36 optionally a copyright information, based on Stats, can be displayed using --copyright flag. This will flag will be added to usage output when this feature is mature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility.cc

    r177 r198  
    2424#include "utility.h"
    2525
     26#include <cstdlib>
    2627#include <fstream>
    27 #include <iostream> // remove this when 'blame' is removed
    2828#include <sstream>
    2929#include <stdexcept>
     
    6767
    6868
     69  std::string getenv(const std::string& var)
     70  {
     71    char* buffer=std::getenv(var.c_str());
     72    if (!buffer)
     73      throw std::runtime_error("Environment variable "+var+" is not set");
     74    return std::string(buffer);
     75  }
     76
     77
    6978  std::string pwd(void)
    7079  {
Note: See TracChangeset for help on using the changeset viewer.