Changeset 784 for branches/replacing_gnuplot/lib/utility.cc
- Timestamp:
- Apr 9, 2009, 10:18:54 PM (14 years ago)
- Location:
- branches/replacing_gnuplot
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/replacing_gnuplot
- Property svn:ignore
-
old new 8 8 autom4te.cache 9 9 INSTALL 10 COPYING11 10 aclocal.m4 12 11 Makefile
-
- Property svn:ignore
-
branches/replacing_gnuplot/lib/utility.cc
r646 r784 2 2 3 3 /* 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 4 Copyright (C) 2006, 2007, 2009 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2008 Peter Johansson 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 29 28 #include <cassert> 30 29 #include <cerrno> 30 #include <cstdio> 31 31 #include <cstdlib> 32 #include <cstring> 32 33 #include <fstream> 33 34 #include <sstream> … … 35 36 #include <string> 36 37 #include <sys/param.h> 38 #include <sys/stat.h> 37 39 #include <unistd.h> 38 40 … … 65 67 66 68 69 std::string concatenate_path(std::string dir, std::string base) 70 { 71 if (dir.empty() || dir==".") 72 return base; 73 if (dir[dir.size()-1]!='/') 74 dir.append("/"); 75 return dir+base; 76 } 77 78 67 79 void copy_file(const std::string& source, const std::string& target) 68 80 { … … 87 99 { 88 100 size_t pos = path.find_last_of("/"); 101 if (pos==std::string::npos) 102 return "."; 89 103 if (pos==path.size()-1) 90 104 return directory_name(path.substr(0,path.size()-2)); … … 180 194 if (code){ 181 195 std::stringstream ss; 182 ss << "mkdir(" << dir << "): failed with error code: errno=" << errno;196 ss << "mkdir(" << dir << "): failed\n" << strerror(errno); 183 197 throw std::runtime_error(ss.str()); 184 198 } … … 324 338 325 339 326 std::string version_string(void)327 {328 std::stringstream ss;329 ss << " (";330 if (DEV_BUILD)331 ss << "r" << svn_revision() << " ";332 ss << "compiled " << compilation_time() << ", " << compilation_date()333 << ")";334 return ss.str();335 }336 337 338 340 std::string match(std::string::const_iterator& first, 339 341 const std::string::const_iterator& last,
Note: See TracChangeset
for help on using the changeset viewer.