Changeset 226 for trunk/lib/utility.cc


Ignore:
Timestamp:
Mar 11, 2007, 8:32:41 PM (15 years ago)
Author:
Peter Johansson
Message:

added reading of config file in Parameter closes ##106 and #98. Move function check_target from svndigest.cc to utility.cc and changed name to node_exist. added support for aliases in Copyright update refs #36

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility.cc

    r204 r226  
    33/*
    44  Copyright (C) 2006 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2007 Peter Johansson
    56
    67  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
     
    7879
    7980
     81  std::string htrim(std::string str)
     82  {
     83    size_t length=str.size();
     84    while(length && isspace(str[length-1]))
     85      --length;
     86    return str.substr(0,length);
     87  }
     88
     89
     90  std::string ltrim(std::string str)
     91  {
     92    size_t i = 0;
     93    while(i<str.size() && isspace(str[i]))
     94      ++i;
     95    return str.substr(i);
     96  }
     97
     98
     99  bool node_exist(const std::string& path)
     100  {
     101    struct stat buf;
     102    return !stat(path.c_str(),&buf);
     103  }
     104
     105
    80106  std::string pwd(void)
    81107  {
Note: See TracChangeset for help on using the changeset viewer.