Changeset 3284
- Timestamp:
- Jul 9, 2014, 7:38:58 AM (9 years ago)
- Location:
- branches/0.12-stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.12-stable/NEWS
r3275 r3284 9 9 - Aligner(double, double) is now explicit (see r3207) 10 10 - GetlineIterator(istream&, char) is now explicit (see r3148) 11 - rename(2) and remove(1) are now implemented (bug #804) 11 12 12 13 A complete list of closed tickets can be found here [[br]] -
branches/0.12-stable/test/utility.cc
r3210 r3284 58 58 void test_fnmatch(test::Suite& suite); 59 59 bool test_fnmatch(bool, std::string, std::string); 60 void test_remove(test::Suite& suite); 61 void test_rename(test::Suite& suite); 60 62 void test_replace(test::Suite& suite); 61 63 … … 218 220 test_dirname(suite); 219 221 test_fnmatch(suite); 222 test_remove(suite); 223 test_rename(suite); 220 224 test_replace(suite); 221 225 … … 648 652 649 653 654 void test_remove(test::Suite& suite) 655 { 656 // at least test linking 657 if (false) 658 utility::remove("foo"); 659 } 660 661 662 void test_rename(test::Suite& suite) 663 { 664 // at least test linking 665 if (false) 666 utility::rename("foo", "bar"); 667 } 668 669 650 670 void test_replace(test::Suite& suite) 651 671 { -
branches/0.12-stable/yat/utility/utility.cc
r3114 r3284 183 183 mkdir_p(dirname(dir), mode); 184 184 mkdir(dir, mode); 185 } 186 187 188 void remove(const std::string& fn) 189 { 190 if (::remove(fn.c_str())) { 191 std::string msg("remove: "); 192 msg += fn; 193 throw errno_error(msg); 194 } 195 } 196 197 198 void rename(const std::string& from, const std::string& to) 199 { 200 if (::rename(from.c_str(), to.c_str())) { 201 std::stringstream ss; 202 ss << "rename" << from << " to " << to << ": "; 203 throw errno_error(ss.str()); 204 } 185 205 } 186 206 -
branches/0.12-stable/yat/utility/utility.h
r3188 r3284 361 361 \see http://linux.die.net/man/3/remove 362 362 363 \since New in yat 0.1 0363 \since New in yat 0.12 364 364 */ 365 365 void remove(const std::string& fn); … … 371 371 \see http://linux.die.net/man/3/rename 372 372 373 \since New in yat 0.1 0374 */ 375 void rename(const std::string& from, const std::string to);373 \since New in yat 0.12 374 */ 375 void rename(const std::string& from, const std::string& to); 376 376 377 377 /**
Note: See TracChangeset
for help on using the changeset viewer.